Swift2.0中解决访问资源库函数 - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error conte错误。

Swift2.0中解决访问资源库函数 - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error conte错误。,第1张

概述//访问保存照片 UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void *contextInfo); //只能调用这个方法  - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)
//访问保存照片
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,dIDFinishSavingWithError error:NSError?,contextInfo: AnyObject) {

print("保存成功")
}

调用:

UIImageWritetoSavedPhotosAlbum(image,self,"image:dIDFinishSavingWithError:contextInfo:",nil)

总结

以上是内存溢出为你收集整理的Swift2.0中解决访问资源库函数 - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error conte错误。全部内容,希望文章能够帮你解决Swift2.0中解决访问资源库函数 - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error conte错误。所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1083246.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存