直接上代码
- (IBAction)saveAction:(id)sender {
UIImageWriteToSavedPhotosAlbum(QRCodeImageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
UIAlertView *alert;
if (error == nil)
{
alert = [[UIAlertView alloc] initWithTitle:nil message:@"小的已经为皇上存到相册,妥妥的~����" delegate:nil cancelButtonTitle:@"朕知道了" otherButtonTitles:nil];
[alert show];
}
else
{
alert = [[UIAlertView alloc] initWithTitle:nil message:@"皇上饶命!照片存储失败了����" delegate:nil cancelButtonTitle:@"来人呐,拖出去斩了" otherButtonTitles:nil];
[alert show];
}
}