Hello. I have a method and I want to pass in a NSString which contains just a single char from an NSTextField. The return value will be an int.
If I pass in value is @"a" the return value would be 1 as an example.
I am getting an error saying the Switch only take integer values?
If I pass in value is @"a" the return value would be 1 as an example.
Code:
-(int)findCritValue: (NSString *) letter{
int i;
switch (letter) {
case @"a":
i = 1;
return i;
break;
default:
break;
}
}
I am getting an error saying the Switch only take integer values?