NSRangeException

Discussion in 'iOS Programming' started by mathcolo, Jan 1, 2011.

  1. mathcolo macrumors 6502a

    Joined:
    Sep 14, 2008
    Location:
    Massachusetts
    #1
    Hi everyone, I've got a really annoying and pesky problem! :D

    Some array in my application is throwing an NSRangeException, but I have no idea which array it is! This is the error:

    Code:
    *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 8 beyond bounds [0 .. 6]'
    Any thoughts on how to figure out exactly which array is causing this? I've tried breakpoints and also many NSLog statements to find where the exception is being thrown, but I haven't been successful. (This is in some code where there are 3-5 nested loops and if statements) Thanks!
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    If you're running your app through the debugger, it should break immediately on the problematic line of code. Go to Run > Debugger.
     
  3. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    Make sure that Run > Stop on Objective-C Exceptions is checked, and of course run the app in the debugger. You'll find the exact line.
     

Share This Page