0
林枚舉ALAssetsLibrary知道我的組照片庫有,如何知道什麼時候結束塊列舉ALAssetsLibrary
我怎樣才能知道什麼時候停止塊枚舉?
NSMutableArray *albumsArray = [NSMutableArray array];
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupAll
usingBlock: ^(ALAssetsGroup *group, BOOL *stop){
if ([group valueForProperty:ALAssetsGroupPropertyName] != nil) {
[albumsArray addObject:[group valueForProperty:ALAssetsGroupPropertyName]];
}
NSLog(@"tu arraya :: %@", albumsArray);
//tha pics?
[group enumerateAssetsUsingBlock: ^(ALAsset *result, NSUInteger index, BOOL *stop){
// ---> ALAsset:
NSLog(@" Stop? %@", (stop ? @"YES" : @"NO"));
}];
}
failureBlock: ^(NSError *error) {
NSLog(@"Failure");
}];
NSLog(@"tu arraya 1:: %@", albumsArray);
它在文檔中告訴你'enumerateGroupsWithTypes:usingBlock:failureBlock:'。 – rmaddy 2014-10-01 03:11:53
爲什麼要投票?這是顯而易見的嗎?,很高興躲在投票後面,並且沒有反饋! – MaKo 2014-10-01 03:14:44
您有反饋意見。答案在該方法的文檔中。 – rmaddy 2014-10-01 03:15:44