使用Xcode找到一个错误 - 尝试插入零值 [英] Finding a bug using Xcode - attempt to insert nil value

查看:98
本文介绍了使用Xcode找到一个错误 - 尝试插入零值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有一个随机的错误,导致它崩溃。我面临的问题是XCode不会告诉我崩溃发生的地方只有下面的信息。有人可以告诉我如何找到可以在代码中找到问题的位置?它应该是崩溃的一样,当应用程序崩溃它总是显示如下。


*终止应用程序由于未知的异常'NSInvalidArgumentException',原因:' - [__ NSCFDictionary
setObject:forKey:]:尝试插入零值(键:0)'
*
首次调用堆栈:(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)终止调用抛出
异常(lldb)



解决方案

您是否开启了异常断点?点击Breakpoint Navigator左下角的 + ,然后选择添加例外Breakpont





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





这将导致代码在发生错误的时候停止。


I am getting a random bug in my app, which is causing it to crash. The problem I am facing is XCode doesn't tell me where the crash is happening only the below information. Can someone tell me how I can find out where I might be able to find the problem within the code? It must be crashing at the same point as when the app does crash it always shows the below.

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

解决方案

Have you turned on exception breakpoints? Click the + at the bottom left of the Breakpoint Navigator, then select Add Exception Breakpont.

You can right click the breakpoint to edit it…

This will cause the code to stop at the point where the error occurs.

这篇关于使用Xcode找到一个错误 - 尝试插入零值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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