当我在iOS 8上为我的应用程序添加自定义输入视图时,我遇到了问题.这在iOS 7上完全正常,但是当切换到iOS 8时,一切都失败了.
这是堆栈跟踪:
2014-06-03 21:23:54.237 MyApp[1910:47245] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x1103f9d40>
should have parent view controller:<StopChooser: 0x11083e200> but requested parent is:<UIInputWindowController: 0x110858800>'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001042eee35 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000103b919a0 objc_exception_throw + 45
    2   CoreFoundation                      0x00000001042eed6d +[NSException raise:format:] + 205
    3   UIKit                               0x00000001023d94cd -[UIViewController _addChildViewController:performHierarchyCheck:notifyWillMove:] + 184
    4   UIKit                               0x0000000102977a2b -[UIInputWindowController changeToInputViewSet:] + 416
    5   UIKit                               0x0000000102973f56 -[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:] + 185
    6   UIKit …我有一个消息应用程序.我UITabeView在ViewController中有一个.我在我的Custom上实现了我的longPressGesture事件,UITableViewCell以便在其上显示UIMenuController(copy-forward和...):
AudioMsgCell
-(void)handleLongPress:(UIGestureRecognizer *)gesture
        [self becomeFirstResponder]; // i crash on this Line
        UIMenuController *menu = [UIMenuController sharedMenuController];
        UIMenuItem *delete = [[UIMenuItem alloc] initWithTitle:@"Delete" action:@selector(Delete:)];
        CGRect targetRect = [self convertRect:[self.bubbleImageView frame]
                                     fromView:self];
        [menu setMenuItems:[NSArray arrayWithObjects:delete,nil]];
        [menu setTargetRect:targetRect inView:self];
        [menu setMenuVisible:YES animated:YES];}
我有一个UIMenuControllerinclude XIB file&some UITextField和myviewController我UIButton查看.
TextingViewController
 [self.view addSubview:self.inputView];
当我在单元格上长按手势时,我会在方法上崩溃
AudioMsgCell
 [self becomeFirstResponder]
我以前遇到过这个问题,当我在iOS 8中实现了额外的键盘时,但现在当我在我的Cell应用程序上做手势时出现此错误:
Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x14459d620> should have parent view controller:<BLTextingViewController: …