ios - 在事务中调用当点击 UI 搜索栏并显示键盘时

标签 ios swift uitableview uisearchbar catransaction

我做了一个 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 时出现,应用程序似乎没有任何问题,所以我现在不知道为什么会发生这种情况以及我应该如何调试它。

我搜索了这条消息警告,我发现当主线程上发生多个动画时会发生这种情况,但在我的应用程序中,唯一发生的动画是在显示键盘时。

You can clone project here

最佳答案

看起来这甚至发生在 Apple 示例项目上: Table Search with UISearchController example

你可以下载项目并运行它,你会看到同样的4 [CATransaction synchronize] 在事务中调用

关于ios - 在事务中调用当点击 UI 搜索栏并显示键盘时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48144576/

相关文章:

ios - 如何在 iOS 中使用启动图像时缩小状态栏

swift - Linux 是否支持 URLSession?

iphone - 在 UITableView 的滚动事件上保护 cell.textLabel.text

ios - 元组中的小数值在 Swift 中给出垃圾值

ios - 类单例初始化不能自动完成

ios - NSPropertyListSerialization 无法为 TableView 中的详细信息 View 设置图像字符串 (iOS)

ios - 获取单元格中的 indexPath.row

ios - 如何通过滑动行来显示在自定义 tableview 单元格内创建的 View ?

ios - 禁用carbonKit半透明效果

iphone - 通过应用内购买将 iPhone 应用提交到 App Store