//是否是png图片
BOOL isjpg = [urlstr hasSuffix:@".jpg"];
//是否是png图片
BOOL ispng = [urlstr hasSuffix:@".png"];
if (isjpg) {
_data = UIImageJPEGRepresentation(_image, 1);
}
if (ispng) {
_data = UIImagePNGRepresentation(_image);
}
//是否是png图片
BOOL isjpg = [urlstr hasSuffix:@".jpg"];
//是否是png图片
BOOL ispng = [urlstr hasSuffix:@".png"];
if (isjpg) {
_data = UIImageJPEGRepresentation(_image, 1);
}
if (ispng) {
_data = UIImagePNGRepresentation(_image);
}