I have a simple table with three kinds of cells in my AppleWatch app. A waiting one, an error one and a multi cell result one. The table is correctly shown but when I click a cell to access the detail page I get this funny crash without the control ever entering my code again. If I remove the call to function:
func setActivity(){
let firstRow = myTable?.rowController(at:0)
print("first row class=\(firstRow.self)")
if firstRow == nil{
self.myTable?.setNumberOfRows(1, withRowType: "WKWaitingRow")
}
}
that would have loaded the WKWaitingRow cell, the crash does not occur any longer - including the firt lin -, notwithstanding of course the other two kinds of cells remain.
This is the crash log:
Exception caught during invocation of received message, dropping incoming message and invalidating the connection.
Exception: [<inArrivoHDWatch_Extension.WKWaitingRow 0x15545f80> valueForUndefinedKey:]: this class is not key value coding-compliant for the key myTable.
[<inArrivoHDWatch_Extension.WKWaitingRow 0x15545f80> valueForUndefinedKey:]: this class is not key value coding-compliant for the key myTable.
(
0 CoreFoundation 0x1f39837b <redacted> + 152
1 libobjc.A.dylib 0x1ea471c3 objc_exception_throw + 38
2 CoreFoundation 0x1f398065 <redacted> + 0
3 Foundation 0x1fc8fe69 <redacted> + 260
4 Foundation 0x1fbeaa83 <redacted> + 226
5 WatchKit 0x2cd602f1 <redacted> + 4234
6 WatchKit 0x2cd5f251 <redacted> + 168
7 CoreFoundation 0x1f39d0e4 <redacted> + 84
8 CoreFoundation 0x1f2c5275 <redacted> + 296
9 Foundation 0x1fdbb611 <redacted> + 22
10 Foundation 0x1fc51e5b <redacted> + 1042
11 Foundation 0x1fbe6923 <redacted> + 750
12 libxpc.dylib 0x1f0d2221 <redacted> + 40
13 libxpc.dylib 0x1f0d068d <redacted> + 1164
14 libdispatch.dylib 0x1ee9c023 <redacted> + 8
15 libdispatch.dylib 0x1eeb2a01 <redacted> + 264
16 libdispatch.dylib 0x1eea8613 <redacted> + 426
17 libdispatch.dylib 0x1eeb33ef <redacted> + 566
18 libdispatch.dylib 0x1eea8613 <redacted> + 426
19 libdispatch.dylib 0x1eea8d21 <redacted> + 546
20 libdispatch.dylib 0x1eea98e7 <redacted> + 194
21 libdispatch.dylib 0x1eeb137b <redacted> + 768
22 libsystem_pthread.dylib 0x1f09d4d3 _pthread_wqthread + 778
23 libsystem_pthread.dylib 0x1f09d1a8 start_wqthread + 12
)