iOS 图片保存手机相册

UIImageWriteToSavedPhotosAlbum(app.erweiImg, 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:@"温馨提示" message:@"保存成功" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]autorelease];

                [alert show];

                return;

    }

    else

    {

        alert = [[[UIAlertView alloc]initWithTitle:@"保存失败" message:@"请打开 设置-隐私-照片 来进行设置" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]autorelease];

                [alert show];

                return;

    }

}


你可能感兴趣的:(ios,图片)