james
james

Reputation: 225

Terminating app due to uncaught exception 'NSRangeException'

I am working on setting page for iPhone.

When I click account menu on setting page. it crashes and shows me this error.

* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArrayM replaceObjectAtIndex:withObject:]: index 4 beyond bounds [0 .. 3]'

Can you tell me where do I suppose to look at?

Upvotes: 1

Views: 676

Answers (1)

Michael Dautermann
Michael Dautermann

Reputation: 89559

In the Xcode debugger, set either a global breakpoint at "replaceObjectAtIndex: withObject" or look for any and all calls to "replaceObjectAtIndex: withObject" in your code and set breakpoints there and see if you can catch where / when the exception happens.

Here's a bit of help from Apple's Xcode documentation, I'm looking at a chapter called "Breakpoint Navigator".

Upvotes: 2

Related Questions