3
我的代碼是工作在OS 4.3 但5我得到關於ALAssetsGroup 爲ALAssetsGroup警告我不明白,所以我得到未找到枚舉 例如它的任何方法見代碼ALAssetsGroup問題與IOS 5
void (^assetEnumerator)(ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop)
{
if(result != nil)
{
[assets addObject:result];
}
};
// Create instance of the Assets Library.
void (^assetGroupEnumerator)(ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop) {
if(group != nil)
{
[group enumerateAssetsUsingBlock:assetEnumerator];
}
};
assets = [[NSMutableArray alloc] init];
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupAlbum
usingBlock:assetGroupEnumerator
failureBlock: ^(NSError *error) {
NSLog(@"failureBlock:%@",error);
}];
任何幫助將不勝感激 感謝