ALAssetsLibrary ALAssetsLibraryDataUnavailableError 错误
我正在努力确保涵盖有关 ALAssetsLibrary 由于任何原因失败的所有基础。在查看调用时可能发生的错误时:
- (void)enumerateGroupsWithTypes:usingBlock:failureBlock;
我注意到 ALAssetsLibraryDataUnavailableError,但没有太多关于可能导致此问题的信息。我想相应地显示错误屏幕。
任何见解将不胜感激。谢谢!
I'm trying to make sure to cover all my bases with regard to ALAssetsLibrary failing for whatever reason. In looking through the possible errors that could occur when calling:
- (void)enumerateGroupsWithTypes:usingBlock:failureBlock;
i noticed that ALAssetsLibraryDataUnavailableError, but there isn't much information about what might cause this. I want to show an error screen accordingly.
Any insight would be appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 3 种情况下遇到了 ALAssetsLibraryDataUnavailableError:
我建议向用户显示一条消息,您遇到此错误,建议:
1. 打开照片应用程序...这通常可以修复不一致的库。
2. 如果这不起作用,请重新启动设备并与 iTunes 同步一次。
干杯,
亨德里克
I encountered the ALAssetsLibraryDataUnavailableError in 3 cases:
I would recommend to display a message to the user, you run into this error, recommending:
1. To open the photos app...this usually fixes an inconsistent library.
2. If that doesn't help to reboot the Device and sync with iTunes one time.
Cheers,
Hendrik
好吧,我发现出现此错误的另一个特殊情况:
在completionSelector 中,提供的 NSError 然后包含 ALAssetsLibrary ALAssetsLibraryDataUnavailableError。
您可能会认为该错误可能是 ALAssetsLibraryAccessUserDeniedError 或 ALAssetsLibraryAccessGloballyDeniedError 之类的其他错误。但事实并非如此。这只是 ALAssetsLibraryDataUnavailableError。
这是在 iPhone 5、iOS 6.0.1 上测试的。也许这不是一个错误,或者是,他们有一天会修复它。
无论如何,“修复”是让用户进入“设置”→“隐私”→“照片”→在此处打开您的应用程序。本地化修复建议消息是错误的 - 它建议打开“照片”应用程序。没有给出有关错误的其他信息。无论如何,用户可能应该知道他/她按下了“拒绝”按钮 - 他们仍然可能错误地这样做了,后来他们不知道发生了什么。
Ok I found out another peculiar circumstance where this error appears:
In the completionSelector, the supplied NSError then contains ALAssetsLibrary ALAssetsLibraryDataUnavailableError.
You would think that the error would be something else like ALAssetsLibraryAccessUserDeniedError or ALAssetsLibraryAccessGloballyDeniedError. But it's not. It's just ALAssetsLibraryDataUnavailableError.
This was tested on iPhone 5, iOS 6.0.1. Maybe it's not an error, or it is and they will fix it someday.
Anyway, the "fix" is to have the user go into Settings→Privacy→Photos→have your app turned on here. The localized fix suggestion message is WRONG - it suggest to open the Photos app. No other information about the error given. Anyway, the user should probably know that he/she pushed the "Deny" button - still they might have done so by mistake and later they would have no idea what is going on.