在事务中调用当UIsearch Bar单击并显示键盘时 [英] Called within transaction When UIsearch Bar clicked and keyboard showed

查看:187
本文介绍了在事务中调用当UIsearch Bar单击并显示键盘时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个ViewController,其中有一个按钮和UITextfield,当我点击按钮时,会出现一个带有UISearchBar的UITableViewController,并显示一个语言列表。我的问题是,当我第一次单击按钮然后在我的控制台上单击UISearchBar时运行应用程序我有此警告

I did a ViewController where there is a button and UITextfield when I click the button a UITableViewController with a UISearchBar is presented and a list of languages is displayed. My issue is when I run the app the first time I click the button and then click the UISearchBar on my console I have this warning


SearchDebugApp [2237:558457] + [事务同步]在事务中调用
SearchDebugApp [2237:558457] + [CATransaction synchronize]在事务
内调用SearchDebugApp [2237:558457] + [CATransaction synchronize]在事务$中调用b $ b SearchDebugApp [2237:558457] +在事务中调用的[CATransaction synchronize]

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

this message happens only the first time I click on the UISearchBar nothing seems to go wrong with the app so I don't now why this is happening and how should I debug it .

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

I searched on this message warning I found out that This happens when more than one animation are taking place on main thread but in my app the only animation that is happening is when the keyboard is showed .

你可以在这里克隆项目

推荐答案

看起来这种情况甚至发生在Apple示例项目上:
使用UISearchController示例进行表搜索

It looks like this is happening even on Apple example project: Table Search with UISearchController example

您可以下载项目并运行它,您将在事务中看到相同的4
[CATransaction synchronize]

You can download the project and run it, you will see the same 4 [CATransaction synchronize] called within transaction

这篇关于在事务中调用当UIsearch Bar单击并显示键盘时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆