Re: Switch/case with NSString?
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