joec
joec

Reputation: 3543

Debugging in Xcode (cocoa touch)

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

Upvotes: 0

Views: 390

Answers (2)

bbum
bbum

Reputation: 162712

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.

Upvotes: 2

Rudedog
Rudedog

Reputation: 4692

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.

Upvotes: -1

Related Questions