Re: Boggled By Bindings
Re: Boggled By Bindings
- Subject: Re: Boggled By Bindings
- From: Patrick Machielse <email@hidden>
- Date: Fri, 01 Oct 2004 13:26:23 +0200
op 01-10-2004 01:20 schreef Scott Stevenson
>
On Sep 30, 2004, at 1:32 PM, Patrick Machielse wrote:
>
>
> + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key;
>
> {
>
> if ( [key isEqualToString:@"infoString"] ) {
>
> return YES;
>
> }
>
> return [super automaticallyNotifiesObserversForKey:key];
>
> }
>
>
>
> since it seems NSArrayController doesn't return the default 'YES' value for
>
> all keys (is this documented, somewhere?). Still, no success.
>
>
I think what you'd actually want here is:
>
>
>
+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key;
>
{
>
if ( [key isEqualToString:@"arrangedObjects"] ) {
>
return YES;
>
}
>
return [super automaticallyNotifiesObserversForKey:key];
>
}
>
>
>
The problem is that the key you're dependent on (arrangedObjects) isn't
>
firing notifications by default. If it was, you should get change
>
notifications for infoString as well. So all you *should* need to do is
>
to activate the key you're dependent on.
>
>
Haven't tested it, though.
This doesn't work either. Also, this is something I don't yet grasp of the
Controller architecture. Out of the box NSArrayController returns _NO_ to
[NSArrayController
automaticallyNotifiesObserversForKey:@"arrangedObjects"];
Yet, I can successfully bind to 'arrangedObjects' and get notified of any
change. So observing and binding suddenly seem unrelated concepts. I still
haven't wrapped my head around this...
Patrick
---
Hieper Software
w: www.hieper.nl
e: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden