雖然試圖呈現聯繫人編輯器VC,我得到的警告:試圖提出<UINavigationController的同時演示正在進行
Warning: Attempt to present <UINavigationController: 0x15fe273f0> on <UINavigationController: 0x15fe0e730> while a presentation is in progress!
的錯誤信息,我相信這是因爲我的UIImagePickerController
仍然有效。
這裏是我的didFinish
方法
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *image = info[UIImagePickerControllerOriginalImage];
animated:YES];
[picker dismissViewControllerAnimated:YES completion:NULL];
[self scanWithImage:image];
}
正如你可以看到第二個消息應該駁回VC,但它沒有,和它保持,直到應用程序的執行結束。
scanWithImage:
最終調用showNewPersonViewController
這裏是方法:
-(void)showNewPersonViewController
{
ABNewPersonViewController *picker = [[ABNewPersonViewController alloc] init];
picker.displayedPerson = _person;
picker.newPersonViewDelegate = self;
UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:picker];
// Change status bar back to black due to white contact creation.
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
[self presentViewController:navigation animated:YES completion:nil];
}
在該方法中,我得到錯誤信息的最後一行,然後應用程序完成它的執行,並返回到主VC。
如何避免這種情況並正確顯示聯繫人創建VC?
如何呈現圖像採集控制器? –