代码之家  ›  专栏  ›  技术社区  ›  Naresh

为什么我懒得加载NSBundle MobileCoReserves。框架

  •  16
  • Naresh  · 技术社区  · 8 年前

    当我从主viewController重定向到另一个viewController时 我明白了

    已加载MobileCoReserves。框架

    系统组的系统组容器。通用域名格式。苹果配置配置文件 /用户/develope/Library/Developer/CoreSimulator/Devices/083C0102-C85F-463A-96F4-CA1B9AC7919D/data/Containers/Shared/SystemGroup/ 系统组。通用域名格式。苹果配置配置文件

    我的代码是。。。

    if (![[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"]) {
        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HasLaunchedOnce"];
        [[NSUserDefaults standardUserDefaults] synchronize];
        NSLog(@"Launched first time");
    } else {
        NSLog(@"Already launched");
        [self getData];
    }
    

    viewDidLoad视图

    if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"]) {
    
        dispatch_async(dispatch_get_main_queue(), ^{
            LoginPageViewController *lpvc = [self.storyboard instantiateViewControllerWithIdentifier:@"LPVC"];
            [self.navigationController pushViewController:lpvc animated:NO];
        });
    } else {
        // My code...
    }
    
    2 回复  |  直到 8 年前
        1
  •  26
  •   Cœur Gustavo Armenta    8 年前

    您收到的消息来自Xcode 9。

    [MC]系统组的系统组容器。通用域名格式。苹果配置文件路径为/Users/develope/Library/Developer/CoreSimulator/Devices/083C0102-C85F-463A-96F4-CA1B9AC7919D/data/Containers/Shared/SystemGroup/SystemGroup。通用域名格式。苹果配置配置文件

    [MC] : 这是一条系统消息。可以安全地忽略此消息。

    https://stackoverflow.com/a/42140442/1033581

    1. 在产品下>方案>编辑方案&燃气轮机;运行时,将OS\u ACTIVITY\u MODE环境变量设置为${DEBUG\u ACTIVITY\u MODE},如下所示:

    OS_ACTIVITY_MODE environment variable to ${DEBUG_ACTIVITY_MODE}

    User-Defined setting DEBUG_ACTIVITY_MODE

        2
  •  0
  •   MOHAMMAD ISHAQ    8 年前

    更新应用程序代理中的代码。

    if (![[NSUserDefaults standardUserDefaults] boolForKey:"HasLaunchedOnce"]){
           LoginPageViewController *lpvc = [self.storyboard instantiateViewControllerWithIdentifier:@"LPVC"];
           self.window.rootViewController = lpvc;
           NSLog(@"Launched first time");
          [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HasLaunchedOnce"];
          [[NSUserDefaults standardUserDefaults] synchronize];
    
    }else {
          MainViewController *mainVC = [self.storyboard instantiateViewControllerWithIdentifier:@"MainVC"];
          self.window.rootViewController = mainVC;
         NSLog(@"Already launched");
         [self getData];
    }