Compile Error with: switch, “expected expression before”

后端 未结 3 1717
礼貌的吻别
礼貌的吻别 2020-12-07 18:28

Cut to the chase I have recreated my problem as it is fairly self explanatory.

this complies without error:

switch (n) {
    case 1         


        
3条回答
  •  甜味超标
    2020-12-07 18:48

    case 0: {
        Loading my nib file;
        break; 
    }
    case 1: {
        Loading another nib file;
        break; 
    }
    Note that if you don't have an assignment (x = y) right after the case it won't be a problem. For example:
    

提交回复
热议问题