libMobileGestalt MobileGestalt.c:890:此平台不支持MGIsDeviceOneOfType

时间:2018-08-01 18:48:25

标签: ios swift xcode

我正在使用Xcode 9,在加载应用程序时不断出现此错误

  

libMobileGestalt MobileGestalt.c:890:此平台不支持MGIsDeviceOneOfType。

如何阻止呢?

2 个答案:

答案 0 :(得分:3)

有同样的问题。我正在使用XCode 10,Swift 4.2。并在IOS 10.13上运行。 在模拟器中内置到XS Max,错误消失了。

答案 1 :(得分:0)

我正在阅读一本旧书(出于个人原因)使用ObjC进行iOS开发,并且当我从 AppDelegate.m 覆盖 didFinishLaunchingWithOptions 时发生了此错误,所以我可以为此设置全局 Navigation Controller

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

     // Override point for customization after application launch.

     self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

     RootController *rootController = [[RootController alloc] init];

     UINavigationController  *navController = [[UINavigationController alloc]initWithRootViewController:rootController];

     self.window.rootViewController = navController;

     [self.window makeKeyAndVisible];

     [rootController release];

     [navController release];

     return YES;

}

Xcode 10.0(10A255)

在iPhone和模拟器上进行了测试(均为iPhone 7-iOS 12)