On Aug 2, 2008, at 2:07 PM, Sandro Noel wrote:

when the Array is filled on application init, the data displays fine, but if I add to the array "programatically"
the new data is not displayed, i've tried:      
[self didChangeValueForKey:@"transactions"];
and [transactionTableView reloadData];


If you're using bindings, you can't just manipulate an NSMutableArray instance variable directly and expect it to post KVO notifications. And don't try to "cheat" and put KVO notifications around all of the various manipulation of your mutable array, either; you'll clutter your code and wind up with subtle bugs if you forget one or use the wrong one in the wrong case.

Instead, just use -mutableArrayValueForKey: to get a proxy to the property and manipulate that. It will post KVO notifications and also manipulate the instance variable that you have backing the property. If you need to intercept the modifications to your property, you can override the mutable-array KVC methods described in <Foundation/ NSKeyValueCoding.h> or in the Key-Value Coding Guide.

 -- Chris

_______________________________________________

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