我几乎完成了将我的iOS应用程序迁移到Swift 3.0。 但我仍然有几个类似于下面的情况。 他们中的大多数人通过将有问题的代码放在主线程上能够解决问题。应用程序从后台线程修改自动布局引擎
在其他一些情况下,我无法弄清楚,我的代码的哪一部分在错误的线程上执行。我得到这样一个消息:
This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
Stack:(
0 CoreFoundation 0x000000018765a1d8 <redacted> + 148
1 libobjc.A.dylib 0x000000018609455c objc_exception_throw + 56
2 CoreFoundation 0x000000018765a108 <redacted> + 0
3 Foundation 0x0000000188241ea4 <redacted> + 192
....................
16 libsystem_pthread.dylib 0x00000001866eece4 <redacted> + 200
17 libsystem_pthread.dylib 0x00000001866ee378 pthread_mutex_lock + 0
18 libsystem_pthread.dylib 0x00000001866edda4 start_wqthread + 4
)
(使用调试器或??当选项),我可以用它来跟踪遵循的路径progran是否有一些特殊的TECHNIC,看到这里发生这种情况?
看一看这样的:http://stackoverflow.com/a/39712843/1208191 –