我正在为 iOS 和 Apple Watch 编写应用程序,需要在 Apple Watch 和 iPhone 之间同步数据。
我这样做是为了将 dat 从 iPhone 发送到这里提到的苹果手表:http: //telliott.io/2015/08/11/how-to-communicate-between-ios-and-watchos2.html
另一种方式,如果我更改我的手表应用程序上的数据并将更新的数据发送到我的 iPhone,如果打开接收消息的 ViewController,则会出现一个奇怪的警告。当它关闭并且我从手表发送更新的数据时,我的控制台上没有警告,如果我打开 ViewController,数据会更新:
2015-11-16 11:28:19.057 GeoSocialRecommender[286:11448] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release.
Stack:(
0 CoreFoundation 0x0000000182410f60 <redacted> + 148
1 libobjc.A.dylib 0x0000000196fc3f80 objc_exception_throw + 56
2 CoreFoundation 0x0000000182410e90 <redacted> + 0
3 Foundation 0x000000018342f2d8 <redacted> + 88
4 Foundation 0x00000001832b5a1c <redacted> + 56
5 Foundation 0x00000001832b15dc <redacted> + 260
6 UIKit 0x0000000187aab8c4 <redacted> + 64
7 UIKit 0x0000000187aac3dc <redacted> + 244
8 UIKit 0x000000018820b1e4 <redacted> + 268
9 UIKit 0x0000000187cb0f10 <redacted> + 176
10 UIKit 0x000000018799f7ac <redacted> + 644
11 QuartzCore 0x000000018719eb58 <redacted> + 148
12 QuartzCore 0x0000000187199764 <redacted> + 292
13 QuartzCore 0x0000000187199624 <redacted> + 32
14 QuartzCore 0x0000000187198cc0 <redacted> + 252
15 QuartzCore 0x0000000187198a08 <redacted> + 512
16 QuartzCore 0x00000001871c7b0c <redacted> + 236
17 libsystem_pthread.dylib 0x00000001979f61e0 <redacted> + 584
18 libsystem_pthread.dylib 0x00000001979f5d58 <redacted> + 136
19 libsystem_pthread.dylib 0x00000001979f553c pthread_mutex_lock + 0
20 libsystem_pthread.dylib 0x00000001979f5020 start_wqthread + 4
)
任何人都可以帮助我解决这个奇怪的警告吗?
这是我收到消息的方法
func session(session: WCSession, didReceiveApplicationContext applicationContext: [String : AnyObject]){
if(WCSession.isSupported()){
self.prefs = Utils().importDataFromSession(prefs, applicationContext: applicationContext)
initializeGUI(true)
}
}