On 4 Jul 2008, at 06:15, Alex Wait wrote:

I have two methods setTheString and theString.

They return the value of another NSTextField on my window.
In IB I binded the value of the textField to App Controller and the Model
Key Path to "theString".

theString() is only called when the app first starts up.

Firstly, it's -theString, not theString().

What you are doing sounds like a big no-no in MVC design. It sounds to me like your code does something like:

- (NSString *)theString
{
        return [textField stringValue];
}


In which case, how on Earth is the binding supposed to know when the result of that method has changed? It is not KVO compliant.

Instead, you want to create a perfectly *standard* accessor method for the -theString and -setTheString: that returns an instance variable. Then, bind both of your text fields to it. That will ensure proper KVO compliance.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to