Save Image to Photo Lib rary


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.