【发布时间】:2014-11-01 22:16:26
【问题描述】:
我正在使用UIImagePickerController 在 iPhone 5S 上拍照。
我可以用
[self.navigationController presentViewController:picker animated:YES completion:^{}];
但是当我想在委托方法中解除它时它不起作用。并且内存将内存增加到 300 MB(之前为 25 MB)。 我这样解雇它:
[picker dismissViewControllerAnimated:NO completion:^{}];
代码在 iPhone 5 上运行良好。
这是我如何初始化它:
UIImagePickerController* picker = [[UIImagePickerController alloc] init]; picker.sourceType = UIImagePickerControllerSourceTypeCamera; picker.modalPresentationStyle = UIModalPresentationCurrentContext;
picker.delegate = self;
picker.allowsEditing = NO;
[self.navigationController presentViewController:picker animated:YES completion:^{}];
【问题讨论】:
-
你能用 [self dismissViewControllerAnimated:NO completion:nil] 试试吗?
-
已经试过了。也没有。
-
我有两件事要尝试。首先,使用 [self] 而不是 [self.navigationController]。其次,确保调用了委托方法。
标签: ios objective-c iphone uiimagepickercontroller iphone-5