Weird Switch error in Obj-C

后端 未结 7 544
天命终不由人
天命终不由人 2020-11-29 00:39

I have this switch statement in my code:

switch(buttonIndex){
      case 0:
         [actionSheet dismissWithClickedButtonIndex:buttonIndex animated:YES];
           


        
相关标签:
7条回答
  • 2020-11-29 01:41

    I've seen this issue before. It has to do with labels in C, and would apply to a label used for gotos as well. The case1:, case2: lines are labels. For whatever reason, the first statement following a label must not be a declaration. I will do some research and update with more information if someone else doesn't give a good answer.

    0 讨论(0)
提交回复
热议问题