• 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: NSPopupButton & URLs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPopupButton & URLs


  • Subject: Re: NSPopupButton & URLs
  • From: Matthew Lindfield Seager <email@hidden>
  • Date: Mon, 28 Dec 2009 05:59:13 +1100

On Monday, December 28, 2009, Jeremy Matthews <email@hidden> wrote:
> Currently, I have a nspopupbutton with some general values "Airbus", "Southwest", "Delta", etc...upon making the proper selection and clicking the "generate" button, it creates the event with said attributes, including the URL. So, I have a list of about 10 items in that popup, and a loooong if statement. Depending on the selectedItem of the nspopupbutton, it grabs the associated url and stuffs it into the method and returns the event.
>
> Normally, I'd take a switch/case approach here, but I've been warned about doing so in Cocoa.
>
> Any ideas?
> It works fine now, but I know that there has to be a more graceful approach.

The first thought that comes to mind is a dictionary. The value from
NSPopupButton being the key that you use to obtain the corresponding
value from the dictionary...?

Matt
_______________________________________________

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: 
 >NSPopupButton & URLs (From: Jeremy Matthews <email@hidden>)

  • Prev by Date: Re: Strange Problems with IBPlugin
  • Next by Date: Re: [Cocoa-students] NSPopupButton & URLs
  • Previous by thread: NSPopupButton & URLs
  • Next by thread: Re: [Cocoa-students] NSPopupButton & URLs
  • Index(es):
    • Date
    • Thread