Reputation: 1268
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!
Upvotes: 3
Views: 567
Reputation: 16298
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.
Upvotes: 0
Reputation: 6293
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
Upvotes: 2