gpt4 book ai didi

ios - XCode4 调试器总是在 Main 中中断

转载 作者:技术小花猫 更新时间:2023-10-29 11:15:22 25 4
gpt4 key购买 nike

升级到 XCode4(v.4.2、4D199)后,似乎每次我的应用程序在调试时崩溃,调试指向 main(),并且堆栈未符号化且无用。

多年来一直运行良好,我不知道哪里出了问题。

我正在使用 GDB。我还根据 this advice 尝试了 LLDB ,它也没有用(类似的,无用的堆栈)。

我的断点有效,我得到了完整的堆栈,并且可以在我的代码遇到这些变量时检查变量。

重现步骤:

注意。这发生在我自己的项目中,但我将在此处使用 Apple 的代码从等式中删除该变量

  1. 从 Apple 下载以下样本:https://developer.apple.com/library/ios/#samplecode/UICatalog/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007710

  2. ImagesViewController 类中,将以下代码添加到 viewDidLoad 方法(因此它会崩溃 - 我们希望它在这个测试中崩溃):

    // please note: this code is designed to crash! I want it to crash, to highlight my issue with XCode.
    NSMutableArray* test = [NSMutableArray new];
    [test insertObject:NULL atIndex:0];
  3. 然后运行应用并点击“图片”行。

  4. 它崩溃并显示如下消息:

    2011-12-23 14:07:02.788 UICatalog[13394:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
    *** First throw call stack:
    (0x37bbb8bf 0x316a11e5 0x37b1020f 0x699f 0x34fac7ff 0x34fb8c39 0x34fb8aa9 0x34fb898f 0x34fb815b 0x34fb7f53 0x34fac673 0x34fac349 0x66c1 0x35026565 0x3509ece7 0x31aec943 0x37b8fa63 0x37b8f6c9 0x37b8e29f 0x37b114dd 0x37b113a5 0x3768ffcd 0x34fa1743 0x2459 0x2418)
    terminate called throwing an exception(gdb)

在 xcode 中查看: enter image description here

最佳答案

感谢brigadir指点我the solution !

效果很好。下面是一些屏幕截图,说明如何为发现我的问题的任何人解决此问题:

step 1

点击断点选项卡的加号按钮

step 2

然后点击完成

关于ios - XCode4 调试器总是在 Main 中中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8612161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com