为什么我得到延迟加载NSBundle MobileCoreServices.framework?

当我从主viewControllerredirect到另一个viewController我得到这个

错误:

延迟加载NSBundle MobileCoreServices.framework,

加载MobileCoreServices.framework,

systemgroup.com.apple.configurationprofilespath的系统组容器path为/ Users / develop / Library / Developer / CoreSimulator / Devices / 083C0102-C85F-463A-96F4-CA1B9AC7919D / data / Containers / Shared / SystemGroup / systemgroup.com.apple。 configurationprofiles

我的代码是…

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

您的消息来自Xcode 9.Xcode 8中的等效消息是:

[MC] systemgroup.com.apple.configurationprofilespath的系统组容器是/Users/develop/Library/Developer/CoreSimulator/Devices/083C0102-C85F-463A-96F4-CA1B9AC7919D/data/Containers/Shared/SystemGroup/systemgroup.com .apple.configurationprofiles

注意[MC] :这是一个系统消息。 这个消息可以安全地忽略。

要隐藏这类消息,请按照https://stackoverflow.com/a/42140442/1033581中的解决scheme进行操作:

  1. 在Product> Scheme> Edit Scheme …> Run下,将OS_ACTIVITY_MODE环境variables设置为$ {DEBUG_ACTIVITY_MODE},如下所示:

OS_ACTIVITY_MODE环境变量为$ {DEBUG_ACTIVITY_MODE}

  1. 转到您的项目构build设置,然后单击+添加名为DEBUG_ACTIVITY_MODE的用户定义的设置。 展开此设置并单击“debugging”旁边的“+”以添加特定于平台的值。 select下拉菜单并将其更改为“Any iOS Simulator SDK”。 然后将其值设置为“default”,如下所示:

用户定义的设置DEBUG_ACTIVITY_MODE

更新您的应用程序委托中的代码。

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