找出nsrangeexception的来源 [英] Finding out source of nsrangeexception

查看:136
本文介绍了找出nsrangeexception的来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个不会一直发生的 NSRangeException 错误(特别是在调试时)。它随机出现,我无法弄清楚它是从哪里来的。我有很多的数组操作,所以它很难消除这样的方式。我的问题是我是否可以得到一个线索,例如调试器输出中的类和行号,例如数字12109和707?:

  2012-03-15 09:25:15.303 appname [12109:707] ***由于未捕获的异常'NSRangeException'终止应用程序,原因:'***  -  [__ NSArrayI objectAtIndex:]:index 2 beyond bounds [0 .. 0]'

任何指针都赞赏。



编辑:
日志的剩余部分:

  ***第一掷调用堆栈:
(0x33ff38bf 0x342431e5 0x33f4b275 0x1702d 0x37662331 0x3761b2b3 0x33f4d435 0x373b79eb 0x373b79a7 0x373b7985 0x373b76f5 0x3744de55 0x374e3e45 0x373aa99b 0x33fc7b4b 0x33fc5d87 0x33fc60e1 0x33f494dd 0x33f493a5 0x307cdfcd 0x373ca743 0x2325 0x22e4)
终止称为抛出异常


解决方案

添加一个异常断点。这将阻止引发异常的行。



在断点导航器中,单击左下角的加号,选择异常断点和所有异常。你应该在所有项目上真正实现这一点,这是非常宝贵的。尽管如此,我们的问题要少得多


I have an NSRangeException error that does not occur all the time(especially when I am debugging). It comes up randomly, and I am unable to figure out where it is coming from. I have lots of array manipulation, so its difficult to eliminate it that way.

My question is whether I can get a clue , for example class and line number from the debugger output, for example what are the numbers 12109 and 707?:

2012-03-15 09:25:15.303 appname[12109:707] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 2 beyond bounds [0 .. 0]'

Any pointers appreciated.

Edit: Remaining part of the log:

*** First throw call stack:
(0x33ff38bf 0x342431e5 0x33f4b275 0x1702d 0x37662331 0x3761b2b3 0x33f4d435 0x373b79eb 0x373b79a7 0x373b7985 0x373b76f5 0x3744de55 0x374e3e45 0x373aa99b 0x33fc7b4b 0x33fc5d87 0x33fc60e1 0x33f494dd 0x33f493a5 0x307cdfcd 0x373ca743 0x2325 0x22e4)
terminate called throwing an exception

解决方案

Add an Exception breakpoint. This will stop on the line that raises the exception.

In the breakpoints navigator, click the plus in the bottom left, choose exception breakpoint, and all exceptions. You should have this on all projects really, it is invaluable. We'd have far fewer questions here, though!

这篇关于找出nsrangeexception的来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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