当我从主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];
}
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...
}
答案 0 :(得分:24)
您拥有的信息来自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]
:
这是一个系统消息。可以安全地忽略此消息。
要隐藏此类消息,请按照https://stackoverflow.com/a/42140442/1033581:
中的解决方案进行操作
答案 1 :(得分:0)
更新应用代理中的代码。
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];
}