且构网

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

此应用程序正在从后台线程swift2.0修改自动布局引擎

更新时间:2022-12-09 10:52:13

我猜测self.weatherResult.text = wCont[0]正在修改类似UILabel或类似内容的内容,在这种情况下,您尝试更改用户界面的一部分来自后台线程–大禁忌.

I'm guessing that self.weatherResult.text = wCont[0] is modifying something like a UILabel or similar, in which case you're trying to change part of your user interface from a background thread – a big no-no.

尝试这样的代码:

dispatch_async(dispatch_get_main_queue()) { [unowned self] in
    self.weatherResult.text = wCont[0]
}