使用UIMenuController时遇到的问题

长按出现UIMenuController

当我给cell添加长按出现UIMenuController时,出现报错,


*** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller: should have parent view controller:<**: **> but requested parent is:'


后台看到这篇文章《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”全部替换成别的字段就没再有报错。

思路来源:https://stackoverflow.com/questions/26928849/error-when-try-becomefirstresponder-call-for-uimenucontroller

你可能感兴趣的:(使用UIMenuController时遇到的问题)