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

Re: [Cocoa-students] NSPopupButton & URLs


  • Subject: Re: [Cocoa-students] NSPopupButton & URLs
  • From: Craig Williams <email@hidden>
  • Date: Sun, 27 Dec 2009 12:02:38 -0700

On Dec 27, 2009, at 11:01 AM, Jeremy Matthews wrote:

> So I have an idea or two, but nothing graceful, so I wanted to know the best way of doing this....
>
> I have an xcode 3.2.1 (10.6+ only project), which has a method that has an optional URL as a parameter. This is mostly a take on the calendarstore framework...I just want to offer the ability for users to include notes and urls from a short cocoa window, which includes some of our own project management info.
>
> 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.
>
> Thanks,
> j


You might give this a try.

http://cocoawithlove.com/2008/11/simplifying-your-code-using.html

Regards,

Craig_______________________________________________

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: NSPopupButton & URLs
  • Next by Date: Re: Removing the dragging image
  • Previous by thread: Re: NSPopupButton & URLs
  • Next by thread: Re: NSPopupButton & URLs
  • Index(es):
    • Date
    • Thread