Return to Snippet

Revision: 23606
at February 10, 2010 01:21 by mracoker


Initial Code
NSString *documentsPath = [NSHomeDirectory() stringByAppendingPathComponent: @"Documents"];
	
NSString *filePath = [documentsPath stringByAppendingPathComponent: @"selectedImage.png"];
	
int i = 0;
	
while ( [[NSFileManager defaultManager] fileExistsAtPath: filePath] )
	{
		filePath = [NSString stringWithFormat: @"%@/%@-%d.@%@", documentsPath, @"selectedImage", ++i, @"png"];
	}

[NSImagePNGRepresentation(image) writeToFile: filePath atomically: YES]

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

Initial Description


Initial Title
Save Image Example

Initial Tags
image

Initial Language
Objective C