Switch case is in protected scope

来源:互联网 发布:ubuntu 杀死所有进程 编辑:程序博客网 时间:2024/06/05 16:55

Switch case is in protected scope


http://stackoverflow.com/questions/8482678/case-in-protected-switch


You should wrap each switch statement with {} braces. For example:

switch (someInt) {    case 0:    {        NSLog(@"Case 0");    }    break;    case 1:    {        NSLog(@"Case 1");    }    break;}


原创粉丝点击