Re: NSController, KVC & AppleScript not co-operating
Re: NSController, KVC & AppleScript not co-operating
- Subject: Re: NSController, KVC & AppleScript not co-operating
- From: mmalcolm crawford <email@hidden>
- Date: Mon, 8 Mar 2004 17:39:20 -0800
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.