Xcode在iOS 8的Main()中抛出一个异常,带有'all exceptions'断点 [英] Xcode throws an exception in Main() in iOS 8 with 'all exceptions' breakpoint

查看:143
本文介绍了Xcode在iOS 8的Main()中抛出一个异常,带有'all exceptions'断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xcode 6(通用汽车,我没有下载测试版),我正在为iOS 7+开发应用程序。对于我的所有项目,我刚刚打开了我曾经在Xcode 5中工作的相同项目。

I am using Xcode 6 (GM, I didn't download betas), and I am developing apps for iOS 7+. For all my projects, I just opened the same projects I used to work on in Xcode 5.

在Breakpoint导航器中,我有 All例外断点。它被设置为 Break:On Throw 。现在,每次我运行我的应用程序(无论是在设备上还是在模拟器中),它都会停止执行返回UIApplicationMain(argc,argv,nil,NSStringFromClass([AppDelegate class])); main()函数中的code>。

In the Breakpoint navigator, I have the All Exceptions breakpoint on. It is set to Break: On Throw. Now, each time I run my app (whether on a device or in simulator), it stops execution on the line return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); in the main() function.

如果我按Play继续执行程序两次,程序运行正常。所以这并不妨碍我工作,但每次手动播放执行并重置我的编辑器都很烦人。

If I press Play to continue program execution twice, the program runs fine. So this doesn't prevent me from working, but it is annoying to have to manually play the execution each time and reset my editors.

我喜欢我设置的行为在Xcode中(将当前编辑器带到执行暂停的位置),并且具有 All Exceptions 断点是重要的IMO。 (所以我不想改变它们)

I like the behaviors I have set up in Xcode (taking the current editor to where the execution has paused), and having that All Exceptions breakpoint is important IMO. (So I don't want to change those)

通过运行相同的代码,使用相同的环境,对于iOS 7目标(再次,设备或模拟器),不抛出异常。

By running the same code, with the same environnements, for an iOS 7 target (again, device or simulator), the exception is not thrown.

任何可能导致这种奇怪行为的线索?

Any clue what could cause this strange behavior?

推荐答案

如评论中所述,您应该通过编辑 All Exceptions 断点来关闭捕获C ++异常。

As stated in the comments, you should turn off catching the C++ exceptions by editing your All Exceptions breakpoint.

为此,请右键单击断点并从 所有中更改例外 Objective-C

In order to do that, right click on your breakpoint and change Exception from All to Objective-C:

C ++代码中的异常是普通应用程序功能的一部分。但是,异常断点没有捕获未处理但是每个引发的异常,即使它们稍后被正确处理,因此停止执行。

Exceptions in C++ code are part of normal app functionality. However, exception breakpoint is not catching unhandled but every raised exceptions, even when they're handled correctly later on, hence the stop in execution.

这篇关于Xcode在iOS 8的Main()中抛出一个异常,带有'all exceptions'断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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