• 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
KVO snag from Applescript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO snag from Applescript?


  • Subject: KVO snag from Applescript?
  • From: Dave Sopchak <email@hidden>
  • Date: Wed, 1 Feb 2006 16:34:33 -0800

Hi all,

I'm putting in AS support for one of my apps, and using Suite Modeler to do it.

So far so good, but I've come across something I can't figure out- I have some properties in the top level app object (subclassed from NSObject), that are KVO compliant and displayed in text fields in a window that is KVOing them through an NSObjectController that is set up in IB.

If I change the value of any of the NSStrings that the text fields are KVOing from the app object ( [self setFoo: @"wow"]), great, they change in the text fields. If I try to change them using an applescript to tickle the accessor methods, I can follow it through with gdb in Xcode just fine, it gets the NSString I'm sending, goes through the setFoo method just like calling it internally. The only thing is, the text fields that are KVOing these values don't change. If I do a script to check and see if I changed the string, I get back a string reflecting my change.

Is there something I'm missing here that would cause a KVObserver to not update if the accessor method is accessed from outside the app?

Here's the source for one of the accessor methods:

-(NSString*)automationComments1{ return automationComments1; }
-(void)setAutomationComments1: (NSString*)newAutomationComments1
{
if(![newAutomationComments1 isEqualToString: automationComments1]){
[ (UltraCellApp*) [[self undoManager] prepareWithInvocationTarget:self] setAutomationComments1: automationComments1];
NSString* tmp = [newAutomationComments1 copy];
[automationComments1 release];
automationComments1 = tmp;
[self didChange];
}
}


Thanks for any and all,

Dave
_______________________________________
The sun never sets on the search for darker skies.

_______________________________________________
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


  • Prev by Date: Re: interface builder's communication problem
  • Next by Date: Re: Learning Cocoa, but no programing experience, possible?
  • Previous by thread: Re: interface builder's communication problem
  • Next by thread: How to create a View Similar to AdressBook PersonInfo View / iCal Task Info View
  • Index(es):
    • Date
    • Thread