我已經嘗試了任何運氣的解僱UIImagePickerController的每一個變化。我究竟做錯了什麼。關閉UIImagePickerController
- (IBAction)choosePhoto
{
self.picker = [[UIImagePickerController alloc] init];
self.picker.delegate = self;
self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:self.picker animated:YES];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)imagePicker
{
NSLog(@"dismiss image picker");
[self dismissModalViewControllerAnimated:NO];
[[self.picker parentViewController] dismissModalViewControllerAnimated:NO];
[self.presentedViewController dismissModalViewControllerAnimated:NO];
[self.presentingViewController dismissModalViewControllerAnimated:NO];
// And every other way i could think of
}
- (void)imagePickerController:(UIImagePickerController *)imagePicker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
.. same stuff here
}
我試圖從父母,祖父母目前的選擇器,navigationController和根控制器和沒有什麼作品。我永遠不會解僱ImagePickerController。
請注意每次都會調用日誌語句。
乾杯
有你嘗試[拾取dismissViewControllerAnimated:YES完成:零] ? – Ushan87 2013-05-10 05:10:24
不行,不行。我應該添加即時通訊使用故事板和弧 – user346443 2013-05-10 05:14:28
你有雙重檢查,UIImagePickerControllerDelegate,UINavigationControllerDelegate設置在你的.h文件? – Ushan87 2013-05-10 05:15:25