Why I am getting Lazy loading NSBundle MobileCoreServices.framework?

六眼飞鱼酱① 提交于 2019-12-03 15:41:27

问题


When I redirect from main viewController to another viewController I'm getting this

Error:

Lazy loading NSBundle MobileCoreServices.framework,

Loaded MobileCoreServices.framework,

System group container for systemgroup.com.apple.configurationprofiles path is /Users/develop/Library/Developer/CoreSimulator/Devices/083C0102-C85F-463A-96F4-CA1B9AC7919D/data/Containers/Shared/SystemGroup/ systemgroup.com.apple.configurationprofiles

My code is...

Appdelegate.m

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...
}

回答1:


The message you have is from Xcode 9. The equivalent message in Xcode 8 would be:

[MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/develop/Library/Developer/CoreSimulator/Devices/083C0102-C85F-463A-96F4-CA1B9AC7919D/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles

Note the [MC]: It is a system message. This message can safely be ignored.

To hide this kind of messages, follow the solution from https://stackoverflow.com/a/42140442/1033581:

  1. Under Product > Scheme > Edit Scheme... > Run, set the OS_ACTIVITY_MODE environment variable to ${DEBUG_ACTIVITY_MODE} so it looks like this:

  1. Go to your project build settings, and click + to add a User-Defined Setting named DEBUG_ACTIVITY_MODE. Expand this setting and Click the + next to Debug to add a platform-specific value. Select the dropdown and change it to "Any iOS Simulator SDK". Then set its value to "default" so it looks like this:




回答2:


Update code in your app delegate.

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];
}


来源:https://stackoverflow.com/questions/46439892/why-i-am-getting-lazy-loading-nsbundle-mobilecoreservices-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!