通过UIImagePickerController选取的图片名称信息

 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { 

    NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];

    ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)    {

        ALAssetRepresentation *representation = [myasset defaultRepresentation];

        weakSelf.imageName = [representation filename];

        NSLog(@"imageName : %@",weakSelf.imageName);

    };

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

    [assetslibrary assetForURL:imageURL resultBlock:resultblock failureBlock:nil];
} 

 

posted @ 2017-01-13 16:55  Milo_D  阅读(510)  评论(0编辑  收藏  举报