UIImageWriteToSavedPhotosAlbum在iOS 6 iPad 3中不起作用 [英] UIImageWriteToSavedPhotosAlbum does not work in iOS 6 iPad 3

查看:471
本文介绍了UIImageWriteToSavedPhotosAlbum在iOS 6 iPad 3中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用下一个功能在我的应用中保存照片:

I'm using the next function to save photos in my app:

 UIImageWriteToSavedPhotosAlbum(pngImage, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);

它适用于iOS 5.1.1设备和iPod / iPhone iOS 6.0设备。

It works well on iOS 5.1.1 devices, and iPod/iPhone iOS 6.0 devices.

但奇怪的是,在iOS 3的iPad 3上保存照片不起作用并返回以下错误:

But strangely photo saving doesn't work on iPad 3 with iOS 6.0 and returns the following error:


错误域= ALAssetsLibraryErrorDomain代码= -3310数据不可用UserInfo = 0x1cd6afc0 {NSLocalizedRecoverySuggestion =启动照片应用程序,NSUnderlyingError = 0x1cdaa140数据不可用,NSLocalizedDescription =数据不可用}

Error Domain=ALAssetsLibraryErrorDomain Code=-3310 "Data unavailable" UserInfo=0x1cd6afc0 {NSLocalizedRecoverySuggestion=Launch the Photos application, NSUnderlyingError=0x1cdaa140 "Data unavailable", NSLocalizedDescription=Data unavailable}

有没有人遇到这个问题,有什么方法可以处理它?<​​/ p>

Did anybody encounter this problem and what are the ways to deal with it?

推荐答案

我能够保存到相机胶卷但是当我升级到iOS 6时它停止工作。事实证明我的应用程序需要(但没有,这是iOS 6中的新功能)访问相机胶卷的权限。要获得许可,请转到设置 - >隐私 - >照片。我可以再次使用
UIImageWriteToSavedPhotosAlbum()
保存到相机胶卷。

I was able to save to the Camera Roll but when I upgraded to iOS 6 it stops working. It turns out my app needs (but does not have, this is new in iOS 6) permission to access the camera roll. To obtain permission, go to Settings -> Privacy -> Photos. I am able to save to the camera roll with UIImageWriteToSavedPhotosAlbum() again.

这篇关于UIImageWriteToSavedPhotosAlbum在iOS 6 iPad 3中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆