iphone - 使用 Xcode 查找错误 - 尝试插入 nil 值

标签 iphone ios xcode debugging xcode4.3

我的应用程序中出现随机错误,导致它崩溃。我面临的问题是 XCode 仅通过以下信息告诉我崩溃发生的位置。有人能告诉我如何找出代码中的问题所在吗?它必须在与应用程序崩溃时相同的时间点崩溃,它总是显示以下内容。

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: 0)' * First throw call stack: (0x381e48bf 0x37d301e5 0x381e47b9 0x381e47db 0x381516bb 0x9237b 0x91121 0x8f0c5 0x8abc1 0x37b9d 0x8b68f 0x3550850f 0x381b0577 0x3813c0cf 0x3547c3fb 0x3547dc2b 0x8d005 0x3814322b 0x34495 0x32e31 0x3372d 0x30a59 0x3813e435 0x7b1df 0x7b88d 0x79e25 0x31ca650f 0x31ca5f01 0x31c8c4ed 0x31c8bd2d 0x37f12df3 0x381b8553 0x381b84f5 0x381b7343 0x3813a4dd 0x3813a3a5 0x37f11fcd 0x31cba743 0x89e8b 0x24a4) terminate called throwing an exception(lldb)

最佳答案

您是否开启了异常断点?单击 Breakpoint Navigator 左下方的 +,然后选择 Add Exception Breakpont

enter image description here

您可以右键单击断点进行编辑...

enter image description here

这将导致代码在错误发生的地方停止。

关于iphone - 使用 Xcode 查找错误 - 尝试插入 nil 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10830784/

相关文章:

iphone - 如何设置以下代码片段中的recipientItems的值?

iphone - 如何使用设备相机在 iphone 应用程序中以编程方式拍摄图片?

ios - 即使 UINavigation 栏存在,UIViewController 的内容也不会显示

ios - Swift 函数异步

ios - 如何防止 Xcode 7 Playgrounds 自动运行?

iphone - 如何在 Core Data 中选择特定的数据?

objective-c - 如何在 iOS 中集成 XMPP 扩展 XEP 0136 以进行聊天存档

ios - 单击特定按钮时显示多个警报 Controller ?

iphone - 如何确保应用程序已正确签名

ios - 按下按钮后xcode自动布局困惑