Save Image Example


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



Copy this code and paste it in your HTML
  1. NSString *documentsPath = [NSHomeDirectory() stringByAppendingPathComponent: @"Documents"];
  2.  
  3. NSString *filePath = [documentsPath stringByAppendingPathComponent: @"selectedImage.png"];
  4.  
  5. int i = 0;
  6.  
  7. while ( [[NSFileManager defaultManager] fileExistsAtPath: filePath] )
  8. {
  9. filePath = [NSString stringWithFormat: @"%@/%@-%d.@%@", documentsPath, @"selectedImage", ++i, @"png"];
  10. }
  11.  
  12. [NSImagePNGRepresentation(image) writeToFile: filePath atomically: YES]

URL: http://www.iphonedevsdk.com/forum/iphone-sdk-development/10006-uiimagepickercontroller-saving-cropped-image.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.