首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我要拖拉加载NSBundle MobileCoreServices.framework?

为什么我要拖拉加载NSBundle MobileCoreServices.framework?
EN

Stack Overflow用户
提问于 2017-09-27 05:08:32
回答 2查看 14.9K关注 0票数 16

当我从主viewController重定向到另一个viewController时,我得到了这个

错误:

延迟加载NSBundle MobileCoreServices.framework, 装载MobileCoreServices.framework, 用于/Users/develop/Library/Developer/CoreSimulator/Devices/083C0102-C85F-463A-96F4-CA1B9AC7919D/data/Containers/Shared/SystemGroup/路径的系统组容器是systemgroup.com.apple.configurationprofiles systemgroup.com.apple.configurationprofiles

我的密码是..。

应用程序.m

代码语言:javascript
复制
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

代码语言:javascript
复制
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...
}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-09-27 16:11:15

您拥有的消息来自Xcode 9。Xcode 8中的等效消息是:

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

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

若要隐藏此类消息,请遵循https://stackoverflow.com/a/42140442/1033581中的解决方案

  1. 在产品>方案>编辑方案.>运行,将OS_ACTIVITY_MODE环境变量设置为${DEBUG_ACTIVITY_MODE},如下所示:

  1. 转到您的项目生成设置,然后单击+添加一个名为DEBUG_ACTIVITY_MODE的用户定义设置。展开此设置并单击Debug旁边的+以添加特定于平台的值。选择下拉列表并将其更改为“任意iOS模拟器SDK”。然后将其值设置为“默认”,如下所示:

票数 26
EN

Stack Overflow用户

发布于 2017-09-27 05:55:47

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

代码语言:javascript
复制
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];
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46439892

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档