当我尝试从我的应用程序中显示UIAlertController
时,应用程序终止,并出现异常UIViewControllerHierarchyInconsistency
。UIViewControllerHierarchyInconsistency当显示UIAlertController时出现异常
视图控制器与故事板
创建和(尝试)显示警报这样创建:
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Title" message:@"Message" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *yesButton = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
...
}];
[alert addAction:yesButton];
[self presentViewController:alert animated:YES completion:nil];
然而,在执行过程中我得到这个在输出:
2016-08-25 09:46:07.536 TrackYou [10554:3165715] *** Terminati NG应用程序由于未捕获的异常 'UIViewControllerHierarchyInconsistency',理由是: '子视图控制器:
<
UICompatibilityInputViewController:0x13f5afd80>应该有父视图控制器:<
的ViewController:0x13f549360>,但要求家长为:<
UIInputWindowController:0x140043c00>'
从相同的ViewController
我使用presentViewController
来呈现一个自定义ViewController,它工作正常。
SettingsViewController *controller = [SettingsViewController new];
[self presentViewController:controller animated:YES completion:nil];
任何想法是什么原因造成的问题?
可能欺骗http://stackoverflow.com/questions/24029113的/ error-when-adding-input-view-to-textfield-ios-8 .. – vaibhav