Ceryni Ceryni - 1 year ago 190
iOS Question

App Crashing Entire Device On Segue for iOS 9 + Xcode 7

UPDATE: I've used one of my DTS for the year on this. Currently working with an Apple Support Engineer. On his suggestion, I've also created a bug report for this. I'll update this thread as time passes hopefully resulting in a FINAL solution.

Somehow, I've figured out a way to create an app that literally reboots a simulator and/or physical device. Hurray for me. This problem started when I upgraded to xcode 7 and started testing against iOS 9. On ANY device/simulator < iOS 9, this problem does not rear its ugly head.

When I run it attached to Xcode, the only log messages I see are

XPC connection interrupted
Terminating since there is no system app.

I have narrowed it down to a section of code that is calling

[self addChildViewController:segue.destinationViewController];

This code is a part of a "MultichildContainerViewController" created in the style of this view controller

At this point, I just don't know where to look/do to fix this problem. If I comment out the addition of the childviewcontroller, everything is fine and the app runs normally. If I do NOT comment it out, it reboots my entire simulator.

Any ideas on where to find additional debug information or potential fixes? I just don't know where to look at this point to find more information to in turn use to ask for help. Any help is appreciated, thanks.

I don't know if this helps, but I was able to hunt this down in the actual iOS Simulator system.log. Doesn't seem to have any references to my own codebase, just backboard?

Oct 16 17:56:29 MyComputer backboardd[43977]: -[NSNull isEqualToString:]: unrecognized selector sent to instance 0x10de1baf0
Oct 16 17:56:29 MyComputer backboardd[43977]: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull isEqualToString:]: unrecognized selector sent to instance 0x10d
*** First throw call stack:
0 CoreFoundation 0x000000010dbf6f65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010df82deb objc_exception_throw + 48
2 CoreFoundation 0x000000010dbff58d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010db4cf7a ___forwarding___ + 970
4 CoreFoundation 0x000000010db4cb28 _CF_forwarding_prep_0 + 120
5 BackBoardServices 0x000000010d020b28 -[BKSHIDEventKeyCommandDescriptor isEqual:] + 155
6 CoreFoundation 0x000000010db1630b -[__NSSetM addObject:] + 411
7 CoreFoundation 0x000000010db466a0 -[NSMutableSet unionSet:] + 736
8 BackBoardServices 0x000000010d0223a3 -[BKSHIDEventRouter addHIDEventDescriptors:] + 38
9 backboardd 0x000000010c73a881 backboardd + 186497
10 libdispatch.dylib 0x000000010e862df5 _dispatch_call_block_and_release + 12
11 libdispatch.dylib 0x000000010e87e4a7 _dispatch_client_callout + 8
12 libdispatch.dylib 0x000000010e868184 _dispatch_queue_drain + 1048
13 libdispatch.dylib 0x000000010e867b3c _dispatch_queue_invoke + 595
14 libdispatch.dylib 0x000000010e869454 _dispatch_root_queue_drain + 565
15 libdispatch.dylib 0x000000010e869218 _dispatch_worker_thread3 + 98
16 libsystem_pthread.dylib 0x000000010ebaa4f2 _pthread_wqthread + 1129
17 libsystem_pthread.dylib 0x000000010eba8375 start_wqthread + 13

EDIT: I also want to stress that this is not simply causing the app to crash, this is causing the WHOLE simulator to reboot. I can also trigger this reboot on a physical device. If this was just a simple case of calling
on an NSNull, shouldn't that ONLY crash my app? Not the whole simulator?

Answer Source

I think I figured it out! I'm pretty sure my problem is the same as yours. Same crash log and situation.

I tried to isolate the problem, so I copied my storyboard into a blank project and removed all connections and made all classes default (no custom classes).

After some playing around, I decided to try to re-link a different split view controller to the same master and detail classes. It works! So I compared all of the settings and literally nothing was different. Damn.

What now? Open the source code. Right click your storyboard in the left pane and select "Open with external editor". This should open up the source code of the storyboard. I compared the source code of the two split view controllers and found a difference.

This is where I looked

<!--Split View Controller-->
    <scene sceneID="X6N-vM-fHn">
            <splitViewController id="xSd-V6-k6W" customClass="SplitViewController" sceneMemberID="viewController">
                <navigationItem key="navigationItem" id="yvV-sB-yKa"/>
                    <segue destination="PW6-z0-erU" kind="relationship" relationship="masterViewController" id="MBC-0A-hls"/>
                    <segue destination="xqk-PP-nzR" kind="relationship" relationship="detailViewController" id="sMq-cw-27p"/>
            <placeholder placeholderIdentifier="IBFirstResponder" id="nG8-BB-Qmu" userLabel="First Responder" sceneMemberID="firstResponder"/>
        <point key="canvasLocation" x="-157" y="-370"/>

What's the difference?


I don't know what it is, or how it got there, but when I removed those 3 lines the crashes went away. There is a UIKeyCommand class, but I never used it so I'm not sure if it's relevant. Hope this helps!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download