Is ALAssetsLibrary enumerateGroupsWithTypes: usingBlock: failureBlock: broken in iOS 4.3.4?

I am developing an iOS application based on the ALAssetsLibrary api (available since 4.0), I use it to retrieve all the images and videos saved on the device, and it was pretty simple to do this. In any case, as soon as I installed iOS 4.3.4 on my iPhone 4, my code stopped working. The sampling line does nothing! The code is as follows (and it works great on iOS 4.3.3):

ALAssetsLibrary *library = [[[ALAssetsLibrary alloc] init] autorelease];

ALAssetsGroupEnumerationResultsBlock assetsEnumerator = ^(ALAsset *result, NSUInteger index, BOOL *stop) { 
// handle asset
    };

ALAssetsLibraryGroupsEnumerationResultsBlock groupsEnumerator = ^(ALAssetsGroup *group, BOOL *stop) { 
// handle group
    };

    ALAssetsLibraryAccessFailureBlock failHandler = ^(NSError *error) {
// handle error
    };


[library enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:groupsEnumerator failureBlock:failHandler];

it seems that enumerateGroupsWithTypes: usingBlock: failureBlock: never gets called because none of my blocks are executed ... and no error occurs! What for? What can I do?

ps: I tried changing the "types" argument, but that is not a problem!

+5
2

, (Apple !), ALAssetsLibrary iOS 4.3.4 ( NSOperations NSOperationQueue). , performSelectorOnMainThread.

EDIT:

iOS 5 , , , , ALAssetsLibrary, performSelectorOnMainThread. .

+8

- :

.

apple doc enumerateGroupsWithTypes: usingBlock: failureBlock.

ALAssetsLibraryAccessGloballyDeniedError, ( "" > "" ).

, , .

0

All Articles