How can I use goto in a switch statement in Objective-C?
问题 In my code I need to be able to jump (goto) a different case within the same switch statement. Is there a way to do this? My code is something like this: (There is a lot of code I just left it all out) switch (viewNumber) { case 500: // [...] break; case 501: // [...] break; . . . . . case 510: // [...] break; default: break; } Thank you for your time! -Jeff 回答1: It's generally very bad practice to unconditionally jump like you're asking. I think a more readable/maintainable solution would be