I used the PickerController
and loaded a few images on to a NSMutableArray
.
Now i need to upload all of these images at once. am using
Common technique for turning a UIImage
into NSData is with one of the following two methods.
NSData *pngData = UIImagePNGRepresentation(myUIImage);
CGFloat quality = 1.0; // ranges from 0 to 1, 0% to 100%
NSData *jpgData = UIImageJPEGRepresentation(myUIImage, quality);
This of course assumes you know which type your image is. But since you used a PickerController
to fetch the images, then it should be fairly easy to determine this. You just pull out the value under the key UIImagePickerControllerReferenceURL
and check the ext
parameter. This comment shows it visually https://stackoverflow.com/a/11506499/1529638.