• 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: Switch/case with NSString?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switch/case with NSString?


  • Subject: Re: Switch/case with NSString?
  • From: Tommy Nordgren <email@hidden>
  • Date: Wed, 3 Jan 2007 12:16:10 +0100


On 3 jan 2007, at 11.32, d2kagw wrote:

Hi there,

Anyone know if its possible to do a switch statement with a NSString? or if there's something similar that you could use as a replacement?

Cheers
	Use a (GLOBAL)NSDictionary that maps  from NSString to NSNumber.

NSNumber * switch_code = [myGlobalDictionary objectForKey: myString];

switch ([switch_code intValue]) {

----
Kine dies, Kinfolk dies, and thus at last yourself
This I know that never dies, how a dead mans deeds are deemed. -- Elder edda
Tommy Nordgren
email@hidden




_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Switch/case with NSString?
      • From: John Stiles <email@hidden>
References: 
 >more than one attribute in tableview cell (From: "email@hidden" <email@hidden>)
 >Re: more than one attribute in tableview cell (From: Volker Runkel <email@hidden>)
 >Switch/case with NSString? (From: d2kagw <email@hidden>)

  • Prev by Date: Re: Switch/case with NSString?
  • Next by Date: Re: slipping NSViews as a NSSplit view under existing window contents.
  • Previous by thread: Re: Switch/case with NSString?
  • Next by thread: Re: Switch/case with NSString?
  • Index(es):
    • Date
    • Thread