Rahul Vyas
Rahul Vyas

Reputation: 28750

Does someone knows about this error in xcode gdb?

2009-07-21 12:47:14.458 FlashCards[1328:20b] * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)'

Upvotes: 0

Views: 1518

Answers (4)

smorgan
smorgan

Reputation: 21619

See the answer to this question for information about how to find out exactly where your exception is being raised using the debugger.

Upvotes: 0

TahoeWolverine
TahoeWolverine

Reputation: 1744

That is your standard array out of bounds exception. I would pull up the debugger and attempt to figure out which array this is. If you do not know, check for which arrays do not have any elements in them, and set breakpoints before using the function objectAtIndex:xyz.

Upvotes: 0

Kim Gräsman
Kim Gräsman

Reputation: 7596

It looks like your application is trying to get the first item from an empty NSCFArray. Does the debugger not point you to the location in the source code causing the exception?

Upvotes: 0

teabot
teabot

Reputation: 15444

Looks like you are trying to access an element in an array that does not exist. You are trying the get the 0th element (the first) but the array has a size of 0 (it's empty).

Start by checking in your code for where you are using arrays and the objectAtIndex: method and then sanity check the array sizes while debugging.

Upvotes: 1

Related Questions