这可能看起来太容易了,或者只是让我感到困惑……或者我太累了,无法理性思考。
我正在尝试使用 imagePickerController 从相册中获取用户已选择的 UIImage 的位置。
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *pic = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
NSData *data = UIImageJPEGRepresentation(pic, 0.01f);
UIImage *image1 = [UIImage imageWithData:data];
bookmarkImage.image = image1;
NSLog(@"new image size = %i", [data length]);
NSURL *url = [info objectForKey:@"UIImagePickerControllerReferenceURL"];
4NSLog(@"%@",url);
ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset *myAsset){
[myAsset valueForProperty:ALAssetPropertyLocation];
};
[self dismissModalViewControllerAnimated:YES];
}
现在,我尝试为 ALAsset调用valueForProperty时遇到了麻烦。这是我得到的错误:
使用未声明的标识符“ALAssetPropertyLocation”。
请帮忙!这真是令人沮丧...我需要照片的位置...