• 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
Bindings Blues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bindings Blues


  • Subject: Bindings Blues
  • From: Mark Davis <email@hidden>
  • Date: Thu, 29 Jul 2004 11:00:54 -0300

My application controller is holding an array _groups. Each group in
the _groups array has a contents array which holds all the objects
stored inside the group.

So when I went to remove an object from one of my groups I simply did this:

[self willChangeValueForKey:@"groups"];
[[[[self groups] objectAtIndex:[groupTable selectedRow]] contents]
removeObjectAtIndex:[contentsTable selectedRow]];
[self didChangeValueForKey:@"groups"];

The first thing I'll hear will probably be that my contents array
isn't mutable. It's an NSMutableArray and I can definitely work with
it.

Whenever I remove the last object in the contents I get an error:

*** -[NSCFArray objectAtIndex:]: index (0) beyond bounds

This error is only displayed when I'm removing the last object from
contents (by last I mean the object that is the farthest bottom in the
list -- not the only object left).

----
Mark Davis
Icecold 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: Bindings Blues
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: cocoa app from scratch
  • Next by Date: Re: earliest code that runs?
  • Previous by thread: Re: Bindings NSArrayController/NSUserDefaultsController nightmare
  • Next by thread: Re: Bindings Blues
  • Index(es):
    • Date
    • Thread