Search code examples
iosswiftuitableviewrowsegue

swift - App Crashes on one single row selection of the many


So the app runs fine in a simulator and on the device when it's running from Xcode.

Once I disconnect the phone from the mac and rerun it the app crashes on one single row and I don't know what's the problem.

It's a static table which I fill in programmatically.

On a row selection i perform a performSegue(withIdentifier: "segueName", sender: cell)

The segue names are all correctly set. (it runs ok in the simulator and when the device is connected).

I'm really stuck. Here's the crash repport:

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libswiftCore.dylib              0x0000000100bc8b84 0x1009d8000 + 2034564
1   libswiftCore.dylib              0x0000000100bc8b84 0x1009d8000 + 2034564
2   libswiftCore.dylib              0x0000000100a31fa8 0x1009d8000 + 368552
3   UtilitaireBA                    0x0000000100473508 0x1003c8000 + 701704
4   UtilitaireBA                    0x0000000100473698 0x1003c8000 + 702104
5   UIKitCore                       0x00000001c7e6a6d4 -[UIClassSwapper initWithCoder:] + 248
6   UIFoundation                    0x00000001a5651cc4 UINibDecoderDecodeObjectForValue + 744
7   UIFoundation                    0x00000001a55f081c -[UINibDecoder decodeObjectForKey:] + 320
8   UIKitCore                       0x00000001c7e6ebbc -[UIRuntimeConnection initWithCoder:] + 188
9   UIKitCore                       0x00000001c7e6ef98 -[UIRuntimeEventConnection initWithCoder:] + 64
10  UIFoundation                    0x00000001a5651cc4 UINibDecoderDecodeObjectForValue + 744
11  UIFoundation                    0x00000001a5651f08 UINibDecoderDecodeObjectForValue + 1324
12  UIFoundation                    0x00000001a55f081c -[UINibDecoder decodeObjectForKey:] + 320
13  UIKitCore                       0x00000001c7e6c4bc -[UINib instantiateWithOwner:options:] + 1124
14  UIKitCore                       0x00000001c8357704 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 196
15  UIKitCore                       0x00000001c8358304 -[UIStoryboardSegueTemplate instantiateOrFindDestinationViewControllerWithSender:] + 92
16  UIKitCore                       0x00000001c8358560 -[UIStoryboardSegueTemplate _perform:] + 56
17  UIKitCore                       0x00000001c7c00b68 -[UIViewController performSegueWithIdentifier:sender:] + 108
18  UtilitaireBA                    0x000000010044e6e0 0x1003c8000 + 550624
19  UtilitaireBA                    0x000000010044e980 0x1003c8000 + 551296
20  UIKitCore                       0x00000001c83cfc14 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1348
21  UIKitCore                       0x00000001c83cfe78 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 268
22  UIKitCore                       0x00000001c81d0cd0 _runAfterCACommitDeferredBlocks + 296
23  UIKitCore                       0x00000001c81beccc _cleanUpAfterCAFlushAndRunDeferredBlocks + 384
24  UIKitCore                       0x00000001c81edfa0 _afterCACommitHandler + 132
25  CoreFoundation                  0x000000019af877a8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
26  CoreFoundation                  0x000000019af8243c __CFRunLoopDoObservers + 412
27  CoreFoundation                  0x000000019af829dc __CFRunLoopRun + 1264
28  CoreFoundation                  0x000000019af821cc CFRunLoopRunSpecific + 436
29  GraphicsServices                0x000000019d1f9584 GSEventRunModal + 100
30  UIKitCore                       0x00000001c81c5054 UIApplicationMain + 212
31  UtilitaireBA                    0x00000001005013e4 0x1003c8000 + 1283044
32  libdyld.dylib                   0x000000019aa42bb4 start + 4

Solution

  • Thank you guys. I still don't know where the problem was.

    I actually redid the entire segue in InterfaceBuilder and went through the entire code for the viewController. Reconnected the outlets 1 by 1 and tried the app as i connected things.

    Now it's working on the simulator and on the device when is and when is not connected.

    If i figure out where the problem was i'll be back.

    Thank you.