I am trying to load UIImage object from NSData, and the sample code was to NSImage, I guess they should be the same. But just now load
UIImage
NSData
NSImage
I didn't try UIImageJPEGRepresentation() before, but UIImagePNGRepresentation works fine for me, and conversion between NSData and UIImage is dead simple:
UIImageJPEGRepresentation()
UIImagePNGRepresentation
NSData *imageData = UIImagePNGRepresentation(image); UIImage *image=[UIImage imageWithData:imageData];