• 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: NSTextField text changed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSTextField text changed
      • From: Ferhat Ayaz <email@hidden>
References: 
 >NSTextField text changed (From: Ferhat Ayaz <email@hidden>)
 >Re: NSTextField text changed (From: "I. Savant" <email@hidden>)
 >Re: NSTextField text changed (From: Ferhat Ayaz <email@hidden>)

  • Prev by Date: Re: NSTextField text changed
  • Next by Date: Re: Annoying 'parse error before' messages
  • Previous by thread: Re: NSTextField text changed
  • Next by thread: Re: NSTextField text changed
  • Index(es):
    • Date
    • Thread