ios - libMobileGestalt MobileGestalt.c :890: MGIsDeviceOneOfType is not supported on this platform

标签 ios swift

<分区>

我正在使用 Xcode 9 我在加载我的应用程序时一直收到此错误

libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.

如何阻止它?

最佳答案

我正在通过一本旧书学习使用 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)

关于ios - libMobileGestalt MobileGestalt.c :890: MGIsDeviceOneOfType is not supported on this platform,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51640360/

相关文章:

ios - Device Farm 在 iOS 上将 "extra data"的 zip 存档的内容放在哪里?

ios - 如何从每个注释 View 创建自定义标注按钮?

ios - Swift2 中的 coreData - 更新条目

ios - 在 UIViewController 前面添加 am UIPageViewController

ios - 调用了 UICollectionView cellForItemAtIndexPath 但数据源为空

ios - 将文本值分配给 JSON 数据

ios - 在显示按钮之前检查是否可以进行应用内购买

xcode - 使用 Swift 在 OSX 中委托(delegate)

swift - 以编程方式切换 RootViewController 会禁用触摸

ios - 以编程方式使用布局 anchor 创建 subview