On Dec 1, 2009, at 16:19, David Hirsch wrote:

> The problem is, when I add a new Room to the master rooms array, and then add 
> that room to the roomCosts array of each Course's roomConstraint, the table 
> column doesn't get updated, until I tweak it manually (by adding a new 
> course).  It is still bound to the existing items in the rooms array - if I 
> alter their name, that get observed and reflected in the table, but adding 
> new ones does not get observed.

...

> @implementation CourseRoomConstraint
> - (void) addRoom:(Room *) newRoom {
>       [roomCosts addObject:[[RoomCost alloc] initWithRoom:newRoom]];
> }

It *looks* like the problem is that you're not adding the RoomCost object 
KVO-compliantly. Instead of just adding objects to a NSMutableArray, you should 
add them to a KVO-compliant mutable array proxy, something like this:

        NSMutableArray* mutableRoomCosts = [self mutableArrayValueForKey: 
"roomCosts"];
        [mutableRoomCosts addObject: ... etc ];


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to