且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从主线程访问布局引擎后,不得从后台线程对其进行修改

更新时间:2022-01-29 23:20:48

在再次查看堆栈跟踪信息后,我终于发现了问题.问题是我在后台线程上更改了UISlider实例的value属性.

I finally found out the problem after taking another look at the stack trace. The problem was that I was changing the value property of a UISlider instance on a background thread.

但是没有地方说明您必须在主线程上对其进行更改! (感谢Apple)显然,UISlider似乎实现了value的setter并强制进行布局或类似操作.

But nowhere does it state that you have to change it on the main thread! (Thanks, Apple) Apparently, it seems like UISlider implements the value's setter and forces a layout or something similar.