• 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 NSMenu to NSArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding NSMenu to NSArray


  • Subject: Re: Binding NSMenu to NSArray
  • From: Keary Suska <email@hidden>
  • Date: Mon, 04 Feb 2013 14:38:55 -0700

On Feb 4, 2013, at 11:15 AM, Geoffrey Holden wrote:

> In the same way that it is possible to bind NSTableView to an NSDictionary,
> is it possible to bind NSMenu to an NSArray?  I have an array of
> dictionaries.  The dictionaries contain the menu name, and may contain a
> further array of dictionaries, to a potential level of eight deep.
>
> I'd like to be able to turn this into a nested NSMenu.  I don't know if
> I've explained myself clearly - but does anyone have any idea how I might
> go about it?  Is there a standard method that I should know about?
>
> If there isn't a standard method then don't worry about it - I'll work it
> out.

NSMenu does not have any bindings. All possible bindings are documented here: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/CocoaBindingsRef/CocoaBindingsRef.html

NSMenu does use delegation and those methods should do what you need, although it is fairly easy to maintain a menu and synchronize it with the kind of data structure you are talking about.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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

References: 
 >Binding NSMenu to NSArray (From: Geoffrey Holden <email@hidden>)

  • Prev by Date: Re: Interface Builder button appearance
  • Next by Date: KVO, which thread?
  • Previous by thread: Binding NSMenu to NSArray
  • Next by thread: NSTask Explodes. Clueless.
  • Index(es):
    • Date
    • Thread