美文网首页
使用UIMenuController时遇到的问题

使用UIMenuController时遇到的问题

作者: JasonXZJ | 来源:发表于2019-08-16 10:32 被阅读0次

    长按出现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”全部替换成别的字段就没再有报错。

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

    相关文章

      网友评论

          本文标题:使用UIMenuController时遇到的问题

          本文链接:https://www.haomeiwen.com/subject/qbqfsctx.html