我的选择图片的代码如下。
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *chosenImage = info[UIImagePickerControllerEditedImage];
self.imageview.image = chosenImage;
NSLog(@"%@",chosenImage);
[picker dismissViewControllerAnimated:YES completion:NULL];
}
答案 0 :(得分:1)
这应该这样做:
NSURL *imagePath = [info objectForKey:@"UIImagePickerControllerReferenceURL"];
NSString *imageName = [imagePath lastPathComponent];