• 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: Binding NSMenuItem 1 to 1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding NSMenuItem 1 to 1


  • Subject: Re: Binding NSMenuItem 1 to 1
  • From: Jeff Johnson <email@hidden>
  • Date: Mon, 20 Aug 2007 18:30:35 -0500

Knut,

I believe that you can get the desired effect by setting your enabled binding's Multiple Values Placeholder to YES.

You can also set the No Selection Placeholder to NO. You probably don't need the "@count" keypath; you can probably just use the Value Transformer "NSIsNotNil".

-Jeff


On Aug 20, 2007, at 4:44 PM, Knut Lorenzen wrote:

I am binding an NSMenuItem (via NSArrayController) with "Availability" ->
"enabled". Think of "Edit" only if 1 item is selected.


Controller Key is set to "selection"
Model Key Path is set to "@count"

Works fine, but my goal is to enable the NSMenuItem only if 1 (and only 1!)
item is selected in the NSArrayController. NSMenuItem remains enabled if
several items are selected.


I've tried virtually every combination of Key and Path settings that looked
promising to no avail. Someone out there to enlighten me?


Cheers,

Knut

_______________________________________________

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: Binding NSMenuItem 1 to 1
      • From: Knut Lorenzen <email@hidden>
References: 
 >Binding NSMenuItem 1 to 1 (From: Knut Lorenzen <email@hidden>)

  • Prev by Date: Re: BOOL problem
  • Next by Date: Re: BOOL problem
  • Previous by thread: Binding NSMenuItem 1 to 1
  • Next by thread: Re: Binding NSMenuItem 1 to 1
  • Index(es):
    • Date
    • Thread