enum - error
Xcode4-OTHER, Mac OS X (10.6.7)
The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.
You can continue to find trusted guidance and support on the official Apple Support site.
We want to thank the community members who have contributed their time and expertise to help others with their Apple products.
The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.
You can continue to find trusted guidance and support on the official Apple Support site.
We want to thank the community members who have contributed their time and expertise to help others with their Apple products.
Review the language documentation for the switch statement.
This is a sample of the correct usage:
enum RequestAction {Play, Options, Help};
int variable = Play;
switch (variable)
{
case Play:
{
// Do something.
break;
}
caseOptions:
{
// Do something else.
break;
}
case Help:
{
// Do something else.
break;
}
default:
{
// Do something when variable is not Play, Options or Help.
break;
}
}
Adding the "int variable = Play;" fixed the errors.
Thank you for your help.
enum - error