• 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
Binding NSMenuItem state in Document-based app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding NSMenuItem state in Document-based app


  • Subject: Binding NSMenuItem state in Document-based app
  • From: Steve Nicholson <email@hidden>
  • Date: Mon, 9 Jun 2008 11:07:49 -0700

I have a document-based app in which I'm trying to bind the state of NSMenuItems to values in my document's window controller. For example, in the window's nib file, I have a checkbox bound to File's Owner/autoscaleX. I'd like the menu item to have the same functionality as that check box and to display the status for whichever window is currently selected.

Since File's Owner is NSApplication in MainMenu.nib I get an exception when I try to bind to autoscaleX. I tried adding an autoscaleX action to FirstResponder and binding to that, but I still get the exception.

I also tried not binding the menu item and just setting its action to FirstResponder's autoscaleX action, but the menu item remains disabled.

I'm sure there's an easy Cocoa way to do this, but I haven't been able to dig it up in the docs or my searches.
_______________________________________________


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 state in Document-based app
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Garbage collector vs variable lifetime
  • Next by Date: Re: TDD/BDD testing methodologies?
  • Previous by thread: Re: TDD/BDD testing methodologies?
  • Next by thread: Re: Binding NSMenuItem state in Document-based app
  • Index(es):
    • Date
    • Thread