What does “invalid mode 'kCFRunLoopCommonModes' …”mean?

本小妞迷上赌 提交于 2019-11-29 02:27:00

问题


Environment: Version 11.0 beta 3 (11M362v)

Here's the full text:

invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. 
This message will only appear once per execution.
Hello World

This message only appears when I click on a UISwitch button that is connected to an action; here, printing "Hello World".

Apparently the behavior of the action isn't affected.

As a comparison, I've created a UIBarButtonItem in the toolbar which behaves normally. So there's something fishy about the switch button.

Question: why would this appear and what does it mean? Remedy?


回答1:


I had a similar problem: When I got the call-back from the UISwitch, I reloaded the UITableView. I think that the call-back is initiated before the UISwitch finishes changing its context, and reloading the cell in that state creates some conflict.

With that theory, I solved my problem like so: I separated the cells into sections, where the cell with the UISwitch was in its own section. When I got the call-back from the UISwitch, I reloaded all the sections except the section that has the cell with the UISwitch.



来源:https://stackoverflow.com/questions/56980875/what-does-invalid-mode-kcfrunloopcommonmodes-mean

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!