Re: NSTextField text changed
Re: NSTextField text changed
- Subject: Re: NSTextField text changed
- From: "I. Savant" <email@hidden>
- Date: Sat, 13 Jan 2007 15:12:24 -0500
On Jan 13, 2007, at 3:00 PM, Ferhat Ayaz wrote:
I don't have the new value in my controller in which I want to
force to display the TextField. The new Data should be calculated
by other values from a manage objects.
It sounds like you're approaching this problem from entirely the
wrong direction. :-) You shouldn't be trying to force a view to
redraw itself ... if its value is bound to a model by Cocoa Bindings
(whether using Core Data or not), you need to be triggering the
appropriate key/value observing notifications. Your view will then
update its display automatically.
So for now, forget about the text field -- that's not where the
problem is.
What you're saying is that you want the text view that is bound to
totalPrice to automatically update when other properties change, right?
What you need to learn is how to register "dependent keys". Read
about the topic here:
http://developer.apple.com/documentation/Cocoa/Conceptual/
KeyValueObserving/Concepts/DependentKeys.html
Put simply, you need to make your totalPrice key dependent on the
other two keys you mentioned. That way, when the value of either of
those keys change, anything bound to totalPrice will automatically
ask your model for the current value of 'totalPrice'.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden