Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Key value observing?



I am having problems with simple Key value observing with a NSTextField into a NSString in my model. (I haven't found an example of this case. Many examples of much harder array stuff, but not this )
in IB, I make an NSObjectController (called MyFileController) associated with an object in my FileOwner (theSession)


I bind the view's NSTextField to a NSString in theSession. with appropriate KeyPath
(selection.currentLocomotion[MyFileController]) .


I change the NSString: currentLocomotion programatically in theSession. (confirmed in the run log)
Shouldn't the view's NSTextField show the latest value? It doesn't in my code.


I even included:
[ self willChangeValueForKey:@"currentLocomotion" ];
...
[ self didChangeValueForKey:@"currentLocomotion" ];
around the changing code in my setCurrentLocomotion method.
From my reading i don't think this is needed, as I set with the KVC method.


The attributes of the NSTextField are:
	Enabled YES
	Editable NO

Any suggestions or examples would be appreciated. Thanks.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.