• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSController, KVC & AppleScript not co-operating
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: NSController, KVC & AppleScript not co-operating
      • From: Don Briggs <email@hidden>
References: 
 >NSController, KVC & AppleScript not co-operating (From: Nicholas Shanks <email@hidden>)

  • Prev by Date: Re: Runloops, Cocoa and Carbon
  • Next by Date: agvtools killing my plists
  • Previous by thread: Re: NSController, KVC & AppleScript not co-operating
  • Next by thread: Re: NSController, KVC & AppleScript not co-operating
  • Index(es):
    • Date
    • Thread