Posted By

arpit on 07/21/09


Tagged

UIImage


Versions (?)

Save Image to Photo Lib rary


 / Published in: Objective C
 

URL: http://iphonesdksnippets.com/post/2009/05/12/Save-image-to-image-library.aspx

  1. -(void)savePictureToLibrary{
  2.  
  3. UIImage *img = [[UIImage imageNamed:@"image.png"];
  4.  
  5. UIImageWriteToSavedPhotosAlbum(img, self, @selector(image:didFinishSavingWithError:contextInfo:), self);
  6.  
  7. }
  8.  
  9.  
  10. - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
  11.  
  12. NSString *str = @"Saved!!!";
  13.  
  14. UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Saved." message:str delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
  15.  
  16. [alert show];
  17.  
  18. }

Report this snippet  

You need to login to post a comment.