Nsrangeexception source detection

I have an NSRangeException error that does not occur all the time (especially when I am debugging). This happens by chance, and I can’t understand where it comes from. I have a lot of manipulation with arrays, so it’s hard to fix it like that.

My question is, can I get the key, for example, the class and line number from the output of the debugger, 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: The rest of the journal:

 *** 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 0x373b79eb 0x373b79a7 0x373b7985 0x373b76f5 0x3744de55 0x374e3e45 0x373aa99b 0x33fc7b4b 0x33fc5d87 0x33fc60e1 0x33f494dd 0x33f493a5 0x307cdfcd 0x373ca743 0x2325 0x22e4) *** 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 
+7
source share
2 answers

Add exception checkpoint. This will stop on the line that throws the exception.

In the breakpoint navigator, click the plus in the lower left corner, select the breakpoint of the exception and all exceptions. You should have it in all projects in fact, it is priceless. Although we would have much less questions!

+50
source

Look down into your crash log, and there is a chance that at some point it will point to the actual method and string.

For example, in the bottom block from the device failure log, the last line clearly indicates the request: didLoad method: in the FacebookController.m class on line 264.

 0x33defacb -[NSObject doesNotRecognizeSelector:] + 175 0x33dee945 ___forwarding___ + 301 0x33d49680 _CF_forwarding_prep_0 + 48 0x00037e47 -[FacebookController request:didLoad:] (FacebookController.m:264) 
+1
source

All Articles