现在的位置: 首页 > 综合 > 正文

ipad 中获取相册中图片名称

2014年02月08日 ⁄ 综合 ⁄ 共 463字 ⁄ 字号 评论关闭

NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];
    ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)
    {
        ALAssetRepresentation *representation = [myasset defaultRepresentation];
        fileName = [representation filename];
        NSLog(@"fileName : %@",fileName);
    };
    
    ALAssetsLibrary* assetslibrary = [[[ALAssetsLibrary alloc] init] autorelease];
    [assetslibrary assetForURL:imageURL
                   resultBlock:resultblock
                  failureBlock:nil];

抱歉!评论已关闭.