iOS:拍摄照片后使用我的iphone相机,如何获得图片计数器ALAsset?
答
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
}
];
+0
,感谢您的回复,因为我用相机拍照,怎么能我得到那张照片?第一资产?还是我可以最后一次获得资产?如果可以,怎么样? – lme
+0
您正在使用imagepicker捕获照片? –
+0
你有没有加入这个方法? - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info –
http://*.com/questions/28255789/getting-url-of-uiimage-selected-from-uiimagepickercontroller看到这个 –