• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help debugging array indexing problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help debugging array indexing problem


  • Subject: Re: Help debugging array indexing problem
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 11 Feb 2011 13:51:12 -0600

On Feb 11, 2011, at 1:27 PM, email@hidden wrote:

> I'm getting this error when clicking between two tables in my application:
> -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)
>
> I've checked my arrays and they are not the problem. I've added NSAsserts to check my array indeces. It appears to be coming from the frameworks. I set breakpoints at both -[NSException raise] and frpintf (found these tips in the archives), but these are never hit. Specifically, when if I click back and forth between the tables, at some point the error appears. It occurs randomly. I can click in the left table and then the right table without seeing the error, but if I continue to alternate clicks, at some point I'll get the error. How can I debug this without having to set a breakpoint on [NSCFArray objectAtIndex:]? Its called way too much. To be clear, no exception is raised. I would expect an NSRangeException, but I see nothing but the above error.

Try a breakpoint on objc_exception_throw instead of -[NSException raise].  Not all exceptions go through the latter.

You can also put a breakpoint on NSLog and friends (or asl_log and friends) if your app is otherwise quiet in terms of console output.

Cheers,
Ken

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Help debugging array indexing problem
      • From: Lorenzo Thurman <email@hidden>
References: 
 >Help debugging array indexing problem (From: email@hidden)

  • Prev by Date: Help debugging array indexing problem
  • Next by Date: Re: [ANN] Cong 0.7
  • Previous by thread: Help debugging array indexing problem
  • Next by thread: Re: Help debugging array indexing problem
  • Index(es):
    • Date
    • Thread