ALAsset valueForProperty:ALAssetPropertyLocation未声明?

这可能看起来太简单了,或者只是让我感到困惑……或者我太累了,不能理性思考。

我正在尝试从使用imagePickerController的相册中获取用户select的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”。

请帮忙! 这真是令人沮丧…我需要照片的位置…

这很愚蠢,但我已经错过了一个导入:

 #import <AssetsLibrary/ALAsset.h> 

感谢markus指出了!