• 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: Please explain this error message...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please explain this error message...


  • Subject: Re: Please explain this error message...
  • From: email@hidden
  • Date: Wed, 20 Feb 2002 18:15:48 -0800

I'm dealing with NS(Mutable)Arrays and NS(Mutable)Dictionaries just to teach
me in Cocoa. Now I'm running into trouble since my small address book app
(which compiles fine) claims an error message while running.
Could someone enlight me what this message means?

-[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)

It means you tried to access the element at index 1 in some array, but the array has only one element (the one at index 0). You may just be running off the end of your array, or you may be confused about the fact that in Foundation, array classes begin with element 0, not element 1 the way arrays do in Pascal and perhaps other languages.
If you can figure out (or already know) how to add a breakpoint on -[NSException raise] in the debugger, you can break on the spot where this is occurring in your code, since Foundation raises an exception in this situation. Having a breakpoint on raise is generally a useful thing.
Good luck...

Ben Haller
Stick Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Please explain this error message...
      • From: Sherm Pendley <email@hidden>
    • Re: Please explain this error message... THANKS!
      • From: Martin Kautz <email@hidden>
  • Prev by Date: Name for '#' glyph.
  • Next by Date: RE: Apps crashs when clicking on menu [OT]
  • Previous by thread: Re: Please explain this error message...
  • Next by thread: Re: Please explain this error message... THANKS!
  • Index(es):
    • Date
    • Thread