我做了一个 ViewController,其中有一个按钮和 UITextfield,当我单击按钮时,会显示一个带有 UISearchBar 的 UITableViewController 并显示一个语言列表。我的问题是当我第一次运行应用程序时单击按钮然后单击控制台上的 UISearchBar 我收到此警告
SearchDebugApp[2237:558457] +[CATransaction synchronize] called within transaction SearchDebugApp[2237:558457] +[CATransaction synchronize] called within transaction SearchDebugApp[2237:558457] +[CATransaction synchronize] called within transaction SearchDebugApp[2237:558457] +[CATransaction synchronize] called within transaction
此消息仅在我第一次单击 UISearchBar 时出现,应用程序似乎没有任何问题,所以我现在不知道为什么会发生这种情况以及我应该如何调试它。
我搜索了这条消息警告,我发现当主线程上发生多个动画时会发生这种情况,但在我的应用程序中,唯一发生的动画是在显示键盘时。
最佳答案
看起来这甚至发生在 Apple 示例项目上: Table Search with UISearchController example
你可以下载项目并运行它,你会看到同样的4 [CATransaction synchronize] 在事务中调用
关于ios - 在事务中调用当点击 UI 搜索栏并显示键盘时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48144576/