34

苹果开发中文网站iOS拾遗——为什么必须在主线程操作UI

 5 years ago
source link: http://www.cocoachina.com/ios/20190118/26167.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
在开发过程中,我们或多或少会不经意在后台线程中调用了UIKit框架的内容,可能是在网络回调时直接imageView.image = anImage,也有可能是不小心在后台线程中调用了UIApplication.sharedApplication。而这个时候编译器会报出一个runtime错误,我们也会迅速的对其进行修正。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK