Why doesn't this work:
NSInteger sectionLocation = 0;
NSInteger sectionTitles = 1;
NSInteger sectionNotifications = 2;
switch (section) {
case sectionLocation:
//
break;
case sectionTitles:
//
break;
case sectionNotifications:
//
break;
default:
//
}
I get this compile error:
error: case label does not reduce to an integer constant
Is it not possible to use NSInteger's like this? If so, is there another way to use variables as cases in a switch statement? sectionLocation
etc. have variable values.