如何在tvOS中使用_whyIsThisViewNotFocusable?

问题描述 投票:2回答:1

要调试焦点问题,可以在tvOS中使用_whyIsThisViewNotFocusable方法,但是在shouldUpdateFocusInContext的调试中使用这个命令,如po [mainView _whyIsThisViewNotFocusable]po mainView _whyIsThisViewNotFocusable,它给了我错误:

error: <EXPR>:1:9: error: consecutive statements on a line must be separated by ';'
mainView _whyIsThisViewNotFocusable

那么_whyIsThisViewNotFocusable的正确用法是什么?

我在一些堆栈溢出的答案中看到了这个问题,但由于声誉较低,我无法在该帖子/答案中发表评论

debugging uikit focus tvos
1个回答
1
投票

大概你正在使用swift,所以你不应该在调试器中使用obj-c。而是使用:

po mainView.performSelector(Selector("_whyIsThisViewNotFocusable")) 
© www.soinside.com 2019 - 2024. All rights reserved.