从UIImage转换到NSData类型
//sdk中提供了方法可以直接调用UIImage *img = [UIImage imageNamed:@"some.png"];NSData *dataObj = UIImageJPEGRepresentation(img, 1.0);//下面是sdk中UIImage.h头文件中的内容UIKIT_EXTERN NSData *UIImagePNGRepresentation(UIImage *image); // return image as PNG. May return nil if image has no CGImageRef or invalid bitmap formatUIKIT_EXTERN NSData *UIImageJPEGRepresentation(UIImage *image, CGFloat compressionQuality); // return image as JPEG. May return nil if image has no CGImageRef or invalid bitmap format. compression is 0(most)..1(least)