Saving UIImage as PNG to photo album on iPhone

2k Views Asked by At

I am merging some png files to a uiimage and I followed this thread ( UIImageWriteToSavedPhotosAlbum save as PNG with transparency? )

and tried to save the result as a png file by replacing this code with my image: [self composeImageWithWidth:100 andHeight:100)..

When I test this using simulator, I go to the folder in application support and find the png there. However when I test this on a real device, I cannot find the png file in my photo album.

What could be going wrong? Perhaps the paths of photo album?

Thanks for the answers

1

There are 1 best solutions below

2
On BEST ANSWER

You can use this function:

UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void *contextInfo);

You only need completionTarget, completionSelector and contextInfo if you want to be notified when the image is done saving, otherwise you can pass in nil.

More info here