P. *_*ami 1 iphone objective-c uiimagepickercontroller ios alasset
这看起来似乎太容易了,也许这对我来说太困惑了......或许我太累了,无法理性思考.
我正在尝试使用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];
}
Run Code Online (Sandbox Code Playgroud)
现在,我尝试为ALAsset 调用valueForProperty是我遇到麻烦的地方.这是我得到的错误:
使用未声明的标识符'ALAssetPropertyLocation'.
请帮忙!这真的令人沮丧......我需要照片的位置......
P. *_*ami 21
这很傻,但我一直错过了一个导入:
#import <AssetsLibrary/ALAsset.h>
Run Code Online (Sandbox Code Playgroud)
感谢Markus指出来的!
| 归档时间: |
|
| 查看次数: |
4362 次 |
| 最近记录: |