How to save UIImage into iPhone’s saved photos album?

How to save UIImage into iPhone’s saved photos album?

This is quite simple, infact it is one row code like everything else in iPhone development. Well, not everything is “quite” simple as this but most of stuff is “quite” easy to implement. Enough with “quite” ! Here is really simple code;

UIImage *myImage = [UIImage imageNamed:@"me.png"];

UIImageWriteToSavedPhotosAlbum(myImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);

// And if you wish add this selector method in code;

- (void) image:(UIImage*)image didFinishSavingWithError:(NSError *)error contextInfo:(NSDictionary*)info;

That’s all you have to add! Quite simple, is it? :-)

2
Top

Enjoyed this post?

Subscribe to our RSS Feed, Follow us on Twitter and spread it to your friends!

Author

Ivan Kalaica

Senior OSX and iOS SDK Developer

At Inchoo and Surgeworks Ivan Kalaica is a Senior OSX and iOS SDK developer.

Other posts from this author

Discussion 2 Comments

Add Comment
  1. passerbycrk

    what I saved are all “jpg”
    How can I save a UIImage as “png”

  2. uday

    thank u so much…..its working….:)

Add Your Comment

Please wrap all source codes with [code][/code] tags.
Top