14
Is there a way to use switch statement with ranges in Objective C (in XCode), hypothetically something like this:
- (NSString *)evaluate:(NSInteger)sampleSize
{
NSString returnStr;
switch (sampleSize)
{
case sampleSize < 10:
returnStr = @"too small!";
break;
case sampleSize >11 && sampleSize <50:
returnStr = @"appropriate";
break;
case sampleSize >50:
returnStr = @"too big!";
break;
}
return returnStr;
}