Created
November 9, 2012 05:55
-
-
Save bluebanboom/4043962 to your computer and use it in GitHub Desktop.
Save UIImage to photos album.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)savedPhotoImage:(UIImage*)image didFinishSavingWithError:(NSError *)error contextInfo: (void *)contextInfo { | |
UIAlertView *alert = nil; | |
if (error == nil) { | |
alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"图片保存成功!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil]; | |
} | |
else { | |
NSLog(@"%@", [error localizedDescription]); | |
NSLog(@"info: %@", contextInfo); | |
alert = [[UIAlertView alloc] initWithTitle:@"错误" message:@"图片保存失败,请重试!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil]; | |
} | |
[alert show]; | |
[alert release]; | |
} | |
- (IBAction)saveBtnClicked:(id)sender | |
{ | |
UIImageWriteToSavedPhotosAlbum([_imageScrollController currentImage], self, @selector(savedPhotoImage:didFinishSavingWithError:contextInfo:), nil); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment