tags:

views:

46

answers:

2

Hi

I get this error when running my iPhone app
2009-12-05 21:32:06.711 iTour[7595:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)'

As per Xcode's debugging practise, i have no line numbers or clue as to where to start, as i have lots of arrays in my app... and the stack trace is just a lot of numbers....

Why doesnt Xcode give line numbers like VS?

Any ideas where this line of code is or where to start?

Thanks

A: 

Are you compiling in release mode? Xcode is perfectly capable of giving you a stack trace with line numbers if it has the debugging information in the binary.

Rudedog
This isn't a crash; there is no usable backtrace by the time that error message is emitted. The only way to debug this is to catch the exception before it is thrown *or* assert that the indices prior to use.
bbum
+1  A: 

You don't get a line number because the program died due to an uncaught exception. An exception was thrown, passing over many frames before being caught by the default exception handler which kills your app.

If you can reproduce the problem, then you can set a breakpoint on either -[NSException raise] or objc_exception_throw (specifically, add those two to the symbolic breakpoints list).

Given that the index is 1, then you have an array with 0 or 1 item in it. That should help narrow it down, too.

bbum