"More than a maximum of 5 filtered albums trying to register. It will fail." Using AssetsLibrary

I sometimes get "More than a maximum of 5 filtered albums trying to register." It will fail. "When I call setAssetsFilter in ALAssetsGroup.

Does anyone know why? I saw similar questions, but all this is related to the UIImagePickerController.

here is the code:

ALAssetsLibrary *lib = [[ALAssetsLibrary alloc] init]; [lib enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) { [group setAssetsFilter:[ALAssetsFilter allPhotos]]; [group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {....}]; 
+6
source share
3 answers

Most of the guys on this saw this question: iOS 5 GM :: More than 5 filtered lists of albums trying to register. It will not succeed . And this: iPhone, "More than a maximum of 5 filtered lists of albums trying to register. This will fail." The error . Therefore, we can believe that this is a known mistake. No big problem.

I also see this comment:

In iOS 5.1.1, I check for the source type and still get a warning when I call the image picker for the 5th time. I do not see this on iOS 6.0, so Apple seems to have fixed something. - Richard Altenburg - Brainchild

+3
source

I think this is an Apple error! .. Even Apple examples give the same error. Better ignore it!

+2
source

Even I ran into this problem, but fixed it. you just need to change the source type of the UIImagePickerController.

UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];

/ * This works fine in IOS6, but has some problems in IOS5 * / //imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; // This will solve the problem.

0
source

Source: https://habr.com/ru/post/923854/


All Articles