这是我的代码:
-(IBAction)addUserChooseImage:(id)sender{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:picker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage: (UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
uploadedImage.image = image;
[picker dismissModalViewControllerAnimated:YES];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[picker dismissModalViewControllerAnimated:YES];
}
试图关闭选择器时它会粘住。我相信原因是图像选择器是由一个按钮激活的,该按钮位于视图控制器本身的加载 nib 视图上。
谁能告诉我什么是解雇它的正确方法?我想代表应该还是指自我,对吧?
谢谢