On Apr 11, 2008, at 11:19, Johnny Lundy wrote:

Now I am running into the "View Doesn't Update When Model Is Changed" issue that Apple lists under "Troubleshooting Cocoa Bindings", in that the array element gets removed by my "removeObjectAtIndex: [theIndex integerValue]", but that is apparently not KVO-compliant.

...

Can someone point me to an example of using removeObjectAtIndex: and having KVO take care of updating the NSTableView? Thanks. I have already declared the model array as mutable, @property (readwrite, copy) and @synthesize.

If 'someObject' is an instance of the class that has playerArray as a property, the KVO-compliant way is:

[[someObject mutableArrayValueForKey:@"playerArray"] removeObjectAtIndex:theWhackedOne];


_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to