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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to