iphone - 总是在主线程上更新UI? [英] iphone - update UI always on Main Thread?
本文介绍了iphone - 总是在主线程上更新UI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道Apple表示所有与UI相关的操作都应该在主线程上进行。
I know Apple said all UI-related operations should be carried out on main thread.
所以我的问题是所有与UI相关的操作真的意味着每一个可能的与UI相关的操作?
So my question is "all UI-related operations" really mean every possible UI-related operaton?
例如,我将在一个单独的线程中将ViewB ViewB添加到ViewA。我应该总是在单独的线程上使用[ViewA performSelectorOnMaintThread:@selector(addSubview :))......
For example, I will addSubview ViewB to ViewA in a separate thread. Should I always use [ViewA performSelectorOnMaintThread:@selector(addSubview:)...... on the separate thread?
谢谢
推荐答案
是。
否则会崩溃。
这篇关于iphone - 总是在主线程上更新UI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文