iOS随笔

iOS 获取相册中图片的url

2017-08-02  本文已影响14人  TIGER_XXXX
 __block NSString *imageFileName;
 NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];
 ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset) {
   ALAssetRepresentation *representation = [myasset defaultRepresentation];
   imageFileName = [representation filename];
 };
 ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];
 [assetslibrary assetForURL:imageURL resultBlock:resultblock failureBlock:nil];
上一篇 下一篇

猜你喜欢

热点阅读