Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ALAssetsLibrary 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!

like image 637
Sahil Avatar asked Apr 08 '26 09:04

Sahil


1 Answers

I encountered the ALAssetsLibraryDataUnavailableError in 3 cases:

  1. When using the simulator and switching between iPhone and iPad simulator.
  2. On the device, when the photo library was corrupt or in an inconsistent state.
  3. After performing an iOS upgrade without having synced to iTunes.

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

like image 160
holtmann Avatar answered Apr 11 '26 01:04

holtmann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!