为什么我要加载Lazy加载NSBundle MobileCoreServices.framework?

iOS*_*iOS 16 objective-c uiviewcontroller ios appdelegate xcode9

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

错误:

懒加载NSBundle MobileCoreServices.framework,

加载MobileCoreServices.framework,

对于systemgroup.com.apple.configurationprofiles路径系统组容器是/用户/开发/库/开发商/ CoreSimulator /设备/ 083C0102-C85F-463A-96F4-CA1B9AC7919D /数据/容器/共享/ 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];
}
Run Code Online (Sandbox Code Playgroud)

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...
}
Run Code Online (Sandbox Code Playgroud)

Cœu*_*œur 26

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

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

注意[MC]:这是系统消息.可以安全地忽略此消息.

要隐藏此类消息,请按照/sf/answers/2949830971/中的解决方案进行操作:

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

OS_ACTIVITY_MODE环境变量为$ {DEBUG_ACTIVITY_MODE}

  1. 转到项目构建设置,然后单击+以添加名为DEBUG_ACTIVITY_MODE的用户定义设置.展开此设置并单击Debug旁边的+以添加特定于平台的值.选择下拉列表并将其更改为"Any iOS Simulator SDK".然后将其值设置为"default",使其如下所示:

用户定义的设置DEBUG_ACTIVITY_MODE

  • @YassineElBadaoui,不,使用`disable`不是我推荐的.我建议使用`default`以避免在Xcode 9上丢失自己的NSLog. (3认同)