iOS:我拍照后使用我的iphone相机,如何获得图片计数器-ALAsset?

时间:2016-06-13 09:14:05

标签: ios camera photo alasset

作为标题,在我用我的iphone相机拍照后,我怎样才能获得ALAsset,这是照片?

1 个答案:

答案 0 :(得分:0)

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


[al enumerateGroupsWithTypes:ALAssetsGroupAll

    usingBlock:^(ALAssetsGroup *group, BOOL *stop)
    {
        [group enumerateAssetsUsingBlock:^(ALAsset *asset, NSUInteger index, BOOL *stop)
        {
            if (asset)
            {                
                 .. do something with the asset
            }
        }
        ];
    }

    failureBlock:^(NSError *error)
    {
        // User did not allow access to library
        .. handle error 
    }
 ];