长按出现UIMenuController
当我给cell添加长按出现UIMenuController时,出现报错,
*** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: **> should have parent view controller:<**: **> but requested parent is:<UIInputWindowController: **>'
后台看到这篇文章《cell长按出错》,才发现报错的原因,
Your view controller probably has a property named inputView that is merely a subview, not an inputView as UIResponder interface expects it to be.
Starting with iOS 8 they check that UIResponder's inputView has no parent.
我把代码中出现的“inputView”全部替换成别的字段就没再有报错。
网友评论