2014-02-12 102 views

回答

3

的方法,我已經採取前:

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

[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) { 

[group setAssetsFilter:[ALAssetsFilter allPhotos]]; 

[group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *alAsset, NSUInteger index, BOOL *innerStop) { 

    if (alAsset) { 
     ALAssetRepresentation *representation = [alAsset defaultRepresentation]; 
     UIImage *latestPhoto = [UIImage imageWithCGImage:[representation fullScreenImage]]; 

     *stop = YES; *innerStop = YES; 

    } 
}]; 
} failureBlock: ^(NSError *error) { 
NSLog(@"Error : %@", [error localisedDescription]); 
}]; 
相關問題