你可以得到一个NSURL路径到对象,但它不是你所期望的。我似乎也无法访问文件中的数据。
- (void)imagePickerController:(UIImagePickerController *)imagepicker didFinishPickingMediaWithInfo:(NSDictionary *)info {
// dismiss the image picker modal
[[imagepicker parentViewController] dismissModalViewControllerAnimated:YES];
// grab the image url
NSURL *imageURL = [info valueForKey: UIImagePickerControllerReferenceURL];
// get the data from the url
NSData *data = [NSData dataWithContentsOfURL:imageURL];
// data is null at this point
}
NSURL对于jpeg文件看起来如下所示。
资产库://asset/asset.JPG ID = 1000000246 & EXT = JPG