Re: programatically updating UI for NSArrayContoller/NSTableView combo
Re: programatically updating UI for NSArrayContoller/NSTableView combo
- Subject: Re: programatically updating UI for NSArrayContoller/NSTableView combo
- From: Russell Gray <email@hidden>
- Date: Sun, 10 Jan 2010 08:50:28 +1100
So, I added an observer to my awakeFromNIb:
[subscriptionsArrayController addObserver: self
forKeyPath: @"arrangedObjects"
options: NSKeyValueObservingOptionNew
context: NULL];
and the following method:
- (void) observeValueForKeyPath: (NSString *) keyPath
ofObject: (id) object
change: (NSDictionary *) change
context: (void *) context
{
NSLog(@"arrangedObjects changed");
}
and as expected i receive the log when I make changes via the UI (altough its getting called multiple times, but I can optimise that later....) but not when I try to add manually?
what would be my next plan of attack here?
On 10/01/2010, at 8:18 AM, Quincey Morris wrote:
> On Jan 9, 2010, at 12:48, Russell Gray wrote:
>
>> Ok, so I do have subscriptions, and subscriptionsArrayContoller set up as you say - I should have mentioned that.
>> I also have the arrayController "Prepares Content" option checked in Interface Builder.
>>
>> I tried all those options you provided. none worked, I still have the same result, the tableView will not update until something is changed via the UI.
>
> You're going to have to narrow down the problem before there's anything we can do to help. It could be something simple like an unconnected IBOutlet, or it could be something to do with bindings, or it could be something to do with the user interface, or it could be that you're adding the object on a non-main thread, or ...
>
> How about if you register your own KVO observer of the "subscriptions" property? Does it get notified when the property changes? Did you check the log for exception error messages?
>
>
> _______________________________________________
>
> 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
_______________________________________________
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