I'd probably go with something like this (simplified, yes, but it covers what you need to do).
Code:
UIGraphicsBeginImageContext(self.view.frame.size);
/*Draw your image into your context here */
UIImageWriteToSavedPhotosAlbum(UIGraphicsGetImageFromCurrentImageContext(), nil, nil, nil);
UIGraphicsEndImageContext();
To fix your current issue though, try:
Code:
//If the image is within the root of your app.
[UIImage alloc imageNamed:@"pic.png"];
//Or, if it isn't in the root but is still within the app bundle: ie /My.app/Images
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"pic" ofType:@"png"]]];
//Or, if the image is in your Documents directory
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *pathToYourImage = [NSString pathWithComponents:[NSArray arrayWithObjects:documentsDirectory, @"pic.png", nil]];
[UIImage imageWithContentsOfFile:pathToYourImage];