Re: NSController, KVC & AppleScript not co-operating
Re: NSController, KVC & AppleScript not co-operating
- Subject: Re: NSController, KVC & AppleScript not co-operating
- From: Don Briggs <email@hidden>
- Date: Tue, 9 Mar 2004 13:09:59 -0800
Hello, all
I'm running Mac OS 10.3.2, build 7D24.
I just tested mmalc's suggestion about overriding
- (void)setValue:newValue forKey:(NSString *)key
in the Model classes.
It doesn't help. I'll continue using
>
[self willChangeValueForKey: thisKey];
>
// main body of the set accessor goes here...
>
[self didChangeValueForKey: thisKey];
On my .Mac homepage
http:/homepage.mac.com/donbriggs
I've posted
ToManyDemo_04Mar09.dmg
among the examples as an update to the "ToManyDemo" there.
The example has some classes to support AppleScriptable to-many
relationships, all under Creative Commons license.
All best,
Don
On Mar 8, 2004, at 5:39 PM, mmalcolm crawford wrote:
>
On Mar 6, 2004, at 2:49 PM, Nicholas Shanks wrote:
>
>
> When I set a parameter in my app via AppleScript, UI elements do not
>
> update.
>
> [...]
>
> Can anyone tell me how to get UI elements bound to NSControllers to
>
> update when applescript changes their values?
>
>
>
Apparently there's a bug in AppleScript support for KVO.
>
>
As a workaround for now you can either do what Don suggested --
>
include manual notification in the model's set accessors:
>
>
[self willChangeValueForKey: thisKey];
>
// main body of the set accessor goes here...
>
[self didChangeValueForKey: thisKey];
>
>
-- or, probably, override setValue:forKey: in your model class to call
>
takeValue:forKey:
>
>
- (void)setValue:newValue forKey:(NSString *)key
>
{
>
[self takeValue:newValue forKey:key];
>
}
>
>
mmalc
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.