【问题标题】:Xcode problems with debug mode and breakpoints调试模式和断点的 Xcode 问题
【发布时间】:2010-11-10 18:13:22
【问题描述】:

我有这样的情况: 当我使用断点运行我的项目时,编译器会转到第一个并像往常一样停止程序,直到我按下下一步按钮。但是当我下一步要走时——他这边没有反应,然后我点击 2-3 次“下一步”(Step into)按钮——之后他将程序运行到最后没有任何反应。

我尝试这样做:Build->Clear All Targets - 但它没有给出任何结果。 尝试重新启动计算机 - 效果相同。

调试器日志如下:

[Session started at 2010-11-11 12:51:11 +0200.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Wed Jul 21 10:53:12 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 1032.
Pending breakpoint 1 - ""RootViewController.m":34" resolved
2010-11-11 12:51:14.542 PhoneBook[1032:207] ******* Accessibility Status Changed: On
2010-11-11 12:51:14.602 PhoneBook[1032:207] ********** Loading AX for: com.yourcompany.PhoneBook ************

The Debugger has exited due to signal 15 (SIGTERM).The Debugger has exited due to signal 15 (SIGTERM).

经过进一步审查,看起来这个代码是原因:

NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [path objectAtIndex: 0];
    NSString *fname = [documentsDirectory stringByAppendingPathComponent: @"phoneBook.sqlite3"];

此代码获取可执行文件的当前目录,然后我在那里创建我的数据库文件。第一次一切都好,第二次 - 坏。可能是什么原因造成的,我该如何解决?

【问题讨论】:

  • 我看到我的应用程序崩溃时会发生这种情况。如果您在没有断点的情况下运行应用程序,您会遇到崩溃吗?
  • 没有。没有断点 - 一切OK!

标签: iphone ios xcode


【解决方案1】:

执行 Cmd + Opt + B 以显示所有断点。删除所有断点。现在通过 iPhone Simulator -> Reset Content and Settings 清除您的模拟器,然后再试一次。

【讨论】:

  • 我试过这样:当我清理文件夹 Library/ApplicationSupport/iPhone Simulator/4.1/Applications/D97A7062-1154-4CF2-B5F7-36C02991DF0F 并删除此文件夹时。当我在此之后第一次启动我的应用程序时 - 调试器工作得很好!之后 - 同样的问题,我所说的。它可以是什么?
【解决方案2】:

检查您的程序日志。听起来应用程序崩溃了。

【讨论】:

    猜你喜欢
    • 2015-10-05
    • 1970-01-01
    • 1970-01-01
    • 2011-07-29
    • 1970-01-01
    • 2012-12-25
    • 1970-01-01
    • 2015-01-23
    • 2011-03-16
    相关资源
    最近更新 更多