UIImage UIImageJPEGRepresentation safe to UIImage

LightNight picture LightNight · Jul 21, 2011 · Viewed 12k times · Source

I need to perform UIImageJPEGRepresentation method and after that save it NOT to file, I need to save it to UIImage. Help please..

Answer

Satish Azad picture Satish Azad · Nov 30, 2012

you can use this:

NSData *imageData = UIImageJPEGRepresentation(uiimageObject,1.0);

UIImage *imageObj = [UIImage imageWithData:imageData];