• 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 and bindings question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO and bindings question


  • Subject: KVO and bindings question
  • From: Don Rainwater <email@hidden>
  • Date: Fri, 28 May 2004 10:40:56 -0400

I have an application in which I'm displaying a table of service provider names. Clicking on a provider in the table shows a summary of transactions to the right of the table. The fields in the summary are bound either to pre-calculated values in the provider record, or to @sum. values of various arrays that are also part of the record. No problems with this - it's actually working quite well.

Also in the summary, I have some text that is only to be displayed when the balance is negative. I had originally thought to observe the balance instance variable in the provider record, but that only changes during the calculation phase, and not when the user is reviewing the provider summaries. I then thought I might be able to observe the text field itself, so I added my controller as an observer of itself, with the key path set to the IBOutlet for the text field, but observeValueForKeyPath:... doesn't seem to fire as I flip through the providers.

Finally, I thought I would define an action for the text field, thinking that the action would fire when the text field changed values from selecting different providers. The action doesn't fire, so no joy there either.

So, with most of the summary display bound to fields in the table records, how can I conditionally set other fields in the summary? I suppose I could make these other fields part of each record and bind them too, but that doesn't seem very elegant.

--
Don Rainwater
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: KVO and bindings question
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: NSFontPanel act on it's own accessory view?
  • Next by Date: Re: Categories and Compiler Warnings
  • Previous by thread: Re: Binding & other actions
  • Next by thread: Re: KVO and bindings question
  • Index(es):
    • Date
    • Thread