适用于 iOS 9 + Xcode 7 的应用程序在 Segue 上崩溃整个设备 [英] App Crashing Entire Device On Segue for iOS 9 + Xcode 7

查看:22
本文介绍了适用于 iOS 9 + Xcode 7 的应用程序在 Segue 上崩溃整个设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:我在这一年中使用了我的一个 DTS.目前与 Apple 支持工程师合作.根据他的建议,我还为此创建了一个错误报告.随着时间的推移,我会更新这个线程,希望能找到最终的解决方案.

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.

不知何故,我想出了一种方法来创建一个真正重启模拟器和/或物理设备的应用程序.为我加油.当我升级到 xcode 7 并开始针对 iOS 9 进行测试时,这个问题就开始了.iOS 9,这个问题不再难看.

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.

当我将它连接到 Xcode 时,我看到的唯一日志消息是

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];

此代码是按照此 视图控制器

此时,我只是不知道去哪里寻找/做什么来解决这个问题.如果我注释掉 childviewcontroller 的添加,一切都很好,应用程序运行正常.如果我不注释掉它,它会重新启动我的整个模拟器.

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.

我不知道这是否有帮助,但我能够在实际的 iOS 模拟器 system.log 中找到它.似乎没有任何对我自己的代码库的引用,只是背板?

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
e1baf0'
*** 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
)

我还想强调,这不仅仅是导致应用程序崩溃,而是导致整个模拟器重新启动.我还可以在物理设备上触发此重新启动.如果这只是一个简单的调用案例isEqualToString在 NSNull 上,这不应该只会使我的应用程序崩溃吗?不是整个模拟器?

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 isEqualToString on an NSNull, shouldn't that ONLY crash my app? Not the whole simulator?

推荐答案

我想我明白了!我很确定我的问题和你的一样.相同的崩溃日志和情况.

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.

这是我看过的

<!--Split View Controller-->
    <scene sceneID="X6N-vM-fHn">
        <objects>
            <splitViewController id="xSd-V6-k6W" customClass="SplitViewController" sceneMemberID="viewController">
                <navigationItem key="navigationItem" id="yvV-sB-yKa"/>
                <keyCommands>
                    <keyCommand/>
                </keyCommands>
                <connections>
                    <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"/>
                </connections>
            </splitViewController>
            <placeholder placeholderIdentifier="IBFirstResponder" id="nG8-BB-Qmu" userLabel="First Responder" sceneMemberID="firstResponder"/>
        </objects>
        <point key="canvasLocation" x="-157" y="-370"/>
    </scene>

有什么区别?

<keyCommands>
    <keyCommand/>
</keyCommands>

我不知道它是什么,也不知道它是如何到达那里的,但是当我删除那 3 条线路时,崩溃就消失了.有一个 UIKeyCommand 类,但我从未使用过它,所以我不确定如果相关.希望这会有所帮助!

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!

这篇关于适用于 iOS 9 + Xcode 7 的应用程序在 Segue 上崩溃整个设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆