我有以下方法,它在拍摄照片后ALAsset
从中检索。UIImagePicker
然后它尝试ALAsset
通过主线程将其发送到我的另一个方法:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSURL *imageURL = [[info valueForKey:UIImagePickerControllerReferenceURL] retain];
__block ALAsset *result;
[self.assetsLibrary assetForURL:imageURL resultBlock:^(ALAsset *asset)
{
result = [asset retain];
dispatch_async(dispatch_get_main_queue(), ^
{
[self loadPhotoImageViewWithAsset:result];
[self dismissModalViewControllerAnimated:YES];
[imageURL release];
[result release];
});
}
failureBlock:^(NSError *error)
{
}];
}
当我进入 时dispatch_async(dispatch_get_main_queue(), ^ block
,result
显示为nil
。有人知道我在这里做错了什么吗?