透過UIImagePickerController,獲取圖片名字、唯一標示UTI、路徑url
[objc]view plaincopy
NSURL*imageURL?=?[infovalueForKey:UIImagePickerControllerReferenceURL];
[selfgetImageDetailInfo:imageURL];
//獲取圖片的詳細信息
-(void)getImageDetailInfo:(NSURL*)imageUrl{
__block?NSString*?imageFileName;
ALAssetsLibrary*?assetslibrary?=?[[ALAssetsLibraryalloc]init];
[assetslibraryassetForURL:imageUrl
resultBlock:^(ALAsset*myasset){
ALAssetRepresentation*representation?=?[myassetdefaultRepresentation];
imageFileName?=?[representationfilename];
NSLog(@"圖片路徑名:%@",imageFileName);
NSLog(@"圖片UTI:%@",[representationUTI]);
NSLog(@"圖片URL:%@",[representationurl]);
}
failureBlock:nil];