Ios UIImagePickerController';我不能在iphone5s上工作

Ios UIImagePickerController';我不能在iphone5s上工作,ios,objective-c,iphone,uiimagepickercontroller,iphone-5,Ios,Objective C,Iphone,Uiimagepickercontroller,Iphone 5,我正在使用UIImagePickerController在iPhone 5S上拍照。 我可以把它作为一个模态来呈现 [self.navigationController presentViewController:picker animated:YES completion:^{}]; 但是当我想在委托方法中取消它时,它就不起作用了。而内存会累积300MB的内存(在此之前是25MB)。 我这样驳回它: [picker dismissViewControllerAnimated:NO compl

我正在使用UIImagePickerController在iPhone 5S上拍照。 我可以把它作为一个模态来呈现

[self.navigationController presentViewController:picker animated:YES completion:^{}];
但是当我想在委托方法中取消它时,它就不起作用了。而内存会累积300MB的内存(在此之前是25MB)。 我这样驳回它:

[picker dismissViewControllerAnimated:NO completion:^{}];
该代码在iPhone5上运行良好

以下是我如何初始化它:


UIImagePickerController*picker=[[UIImagePickerController alloc]init];picker.sourceType=UIImagePickerController源类型摄像头;picker.modalPresentationStyle=UIModalPresentationCurrentContext;
picker.delegate=self;
picker.allowsdediting=否;
[self.navigationController presentViewController:picker动画:是完成:^{}];

如果您没有完成处理程序,请传入nil而不是^{}

[picker dismissViewControllerAnimated:NO completion:nil];

你能试试[self DismissionViewControlleranimated:NO completion:nil]吗?已经试过了。也没什么。我有两件事要尝试。首先,使用[self]而不是[self.navigationController]。其次,确保调用了委托方法。