刚遇到一个问题,就是想在switch函数中的创建视图控制器老是出错。用if就没事。

1.

iOS -switch函数中的case,初始化视图时需要加“{}”

2.

iOS -switch函数中的case,初始化视图时需要加“{}”

 

3.

iOS -switch函数中的case,初始化视图时需要加“{}” 

经过查资料发现是switch的zuoz

switch (status_num) {

            case 1:

            {

              RootTabBarController *rootVC = [[RootTabBarController alloc]init];

              //标记为已登录

              [IsLoginSingleClass shareSingleClass].isLogin = YES;

              [self.navigationController pushViewController:rootVC animated:YES];

            }

                break;

                

            default:

                break;

        }

 

相关文章:

  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
猜你喜欢
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案