Swift2.0中解决访问资源库函数 - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error conte错误。
来源:互联网 发布:wampserver mysql密码 编辑:程序博客网 时间:2024/05/16 15:51
//访问保存照片
UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void *contextInfo);
//只能调用这个方法
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo;
//Swfit2.0中要改变这个方法 - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo;
改变方法为:
//解释:didFinishSavingWithError为外部参数。 在OC中有两个contextInfo ,Swift中自动推断后,删除一个contextInfo.
@objc private func image(image: UIImage, didFinishSavingWithErrorerror:NSError?,contextInfo:AnyObject) {
print("保存成功")}
调用:
UIImageWriteToSavedPhotosAlbum(image, self, "image:didFinishSavingWithError:contextInfo:" , nil)
0 0
- Swift2.0中解决访问资源库函数 - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error conte错误。
- fatal error LNK1000: Internal error during IMAGE::BuildImage错误解决
- UIImage (Crop)解决UIImagePNGRepresentation(image)图片问题
- UBI error: process_eb: bad image sequence number错误解决
- normalized image segmentation software Ncut_9中版本错误解决
- vc2008 fatal error LNK1000: Internal error during IMAGE::BuildImage错误解决
- Error Loading Radchart Image 问题及解决
- ERROR: the user data image is used by another emulator. aborting错误怎么解决
- ERROR: the user data image is used by another emulator. aborting错误怎么解决(转)
- ERROR: the user data image is used by another emulator. aborting错误怎么解决
- ERROR: the user data image is used by another emulator. aborting错误怎么解决
- ERROR: the user data image is used by another emulator. aborting错误怎么解决
- ERROR: the user data image is used by another emulator. aborting错误怎么解决
- ERROR: the user data image is used by another emulator. aborting错误怎么解决
- 【问题】maven项目中com.sun.image.codec.jpeg错误解决
- Image
- Image
- Image
- [59]Spiral Matrix II
- VS2010出现error LNK1123:转换到COFF期间失败
- ubuntu安装android-studio
- Android开发Hack1-圆角镂空按钮的样式定义
- 常用的数据结构
- Swift2.0中解决访问资源库函数 - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error conte错误。
- (2) 事务
- 计算机专业英语汇总(二)
- 前端知识点笔记
- libevent源码分析
- mysql 学习记录(十六)--优化常用sql
- 第六周-数制转换
- JAVA多线程实现的三种方式
- 背包之01,完全,多重模板