当我点击照片库中的照片时,它会转到另一个带有xip的视图控制器并在xip中显示此图像。还有一个细节按钮。当按下细节按钮时,我想在该xip上显示所选图像的创建日期,位置大小,图像路径,相机信息和白平衡。
请帮助我如何在目标c中执行此操作。
答案 0 :(得分:0)
不要忘记在构建阶段添加框架工作
#import <AssetsLibrary/AssetsLibrary.h>
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
NSURL *refURL = [info valueForKey:UIImagePickerControllerReferenceURL];
// define the block to call when we get the asset based on the url (below)
ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *imageAsset)
{
ALAssetRepresentation *imageRep = [imageAsset defaultRepresentation];
NSLog(@"[imageRep filename] : %@", [imageRep filename]);
};
// get the asset library and fetch the asset based on the ref url (pass in block above)
ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];
[assetslibrary assetForURL:refURL resultBlock:resultblock failureBlock:nil];
}