I'm developing an iOS app that is based on ALAssetsLibrary api (available since 4.0), I use it to retrieve all the images and videos saved on the device and it's been pretty simple to do that. Anyway as soon I installed iOS 4.3.4 on my iPhone 4, my code stopped working. The line which invokes the fetching does nothing! The code is the following (and it works fine 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 get called, because none of my blocks are executed... and no error is raised! Why? What can I do?
ps: I tried to change "types" argument, but that's not the problem!