• 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 or Value Transformer?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO or Value Transformer?


  • Subject: KVO or Value Transformer?
  • From: Trygve Inda <email@hidden>
  • Date: Thu, 02 Apr 2009 18:53:17 +0000
  • Thread-topic: KVO or Value Transformer?

I need to enable a view if the value of a popup menu is kSomeValue or
kSomeOtherValue, and disable it otherwise.

The popup's value is bound to an NSNumber in a NSDictionary.

I think I could add an observer for this and manually enable/disable the
view when the popup value meets my criteria...

or

I could use a custom value transformer that returns a Boolean and convert
kSomeValue and kSomeOtherValue to YES, everything else to NO and bind the
enabled state directly to the popup value, with the transformer.

Which is the better way?

Thanks,

Trygve


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: KVO or Value Transformer?
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: [Q] doubleAction on a NSTableView misbehaving?
  • Next by Date: Re: disable row highlighting NSTableView
  • Previous by thread: Re: [Q] doubleAction on a NSTableView misbehaving?
  • Next by thread: Re: KVO or Value Transformer?
  • Index(es):
    • Date
    • Thread