Groups

When permission has been granted by the user, the enumerateAssetGroupsBlock block will be executed. The block will be executed on the main thread, but there is no guarantee when the block will be called since it might be waiting for permission. So any logic in that block needs to take that into consideration. The block signature accepts an instance of ALAssetsGroup and a pointer to a BOOL. If you want to immediately stop iterating, set the BOOL pointer stop to YES.

void (^enumerateAssetGroupsBlock)(ALAssetsGroup*, BOOL*) =^(ALAssetsGroup* group, BOOL* stop){    if (group)    {        ...    }    else    {        [self setAssetGroupArray:         [NSArray arrayWithArray:setupArray]];        [setupArray release ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.