AssetsLibrary を使用している場合は、このコードを記述できます
- (void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
UIImagePickerController *imagePicker;
if (buttonIndex < 2)
{
self.library = [[[ALAssetsLibrary alloc] init] autorelease];
self.imageEditor = [[[DemoImageEditor alloc] initWithNibName:@"DemoImageEditor" bundle:nil] autorelease];
self.imageEditor.doneCallback = ^(UIImage *editedImage, BOOL canceled){
if(!canceled)
{
anotherImage = true;
NSString *imageName;
imageName =@"Abc.jpg";
UIImageWriteToSavedPhotosAlbum(editedImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
editedImage = [self scaleImage:editedImage toSize:CGSizeMake(600,600)];
[[NSUserDefaults standardUserDefaults] setObject:UIImagePNGRepresentation(editedImage)forKey:@"image"];
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
UIAlertView *alert;
if (error)
alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Unable to save image to Photo Album."
delegate:self cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
else
alert = [[UIAlertView alloc] initWithTitle:@"Success"
message:@"Image saved to Photo Album."
delegate:self cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert release];
}
それはあなたのケースを解決します。