You should probably try rewrite your code, like a recursive call or just factor out common stuff and call a separate function. But as a fix and quick answer to your question you could put a label before your switch and goto it, like so
switchLabel:
switch(viewNumber) {
case 500: {
viewNumber = 501;
goto switchLabel;
}
}
Not sure of the Objective-C syntax here, but you could also try a variation thereof
int lastView = 0;
while (lastView != viewNumber)
switch(lastView = viewNumber) {
case 500: {
viewNumber = 501;
break;
}
}
which will keep on looping until the viewNumber doesn t change any more. This is still pretty much just a pretty-looking goto though.
And since we re doing gotos you could just goto into another case, as pointed out already. You could also do fancy stuff similar to Duff s device, by putting cases inside of other blocks. But that s just mad.. :)