Re: Some crash.
Re: Some crash.
- Subject: Re: Some crash.
- From: Chris Hanson <email@hidden>
- Date: Sat, 02 Aug 2008 17:08:37 -0700
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 (email@hidden)
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:
This email sent to email@hidden