Is there a better way in Objective-C to do:
if ([elementName isEqual:@"one"]){ // do some stuff } else if ([elementName isEqual:@"two"]]{ // do more stuff } else if ([elementName isEqual:@"three"]]{ // do more stuff }
ideally, I would like something like:
//BAD CODE, NOT REAL!!! switchString(elementName){ @"one": // do stuff break; @"two": // do more stuff break; @"three": // do more stuff break; }