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) {
};
ALAssetsLibraryGroupsEnumerationResultsBlock groupsEnumerator = ^(ALAssetsGroup *group, BOOL *stop) {
};
ALAssetsLibraryAccessFailureBlock failHandler = ^(NSError *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!