首页 > 解决方案 > iOS 应用程序可在 iPhone(12.4.5) 上运行,但不能在 iPad (13.3.1) 上运行

问题描述

这是我的问题:我有一个正在开发的 iOS 应用程序。它在装有 iOS 12.4.5 的 iPhone 6 上运行良好。当我想在装有 iOS 13.3.1 的 iPad Mini 上运行它时;我在 Xcode 的调试控制台(版本 11.3.1)中得到了这个:

2020-03-02 ... *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: 'Could not find a storyboard named 'Main' in bundle NSBundle
</private/var/containers/Bundle/Application/5...1/MyApp.app> (loaded)'
*** First throw call stack:
(0x1824e8a48 0x18220ffa4 ..... 0x1822ea360)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

对任何人都有意义吗?

它说“找不到故事板......”。事实上,我已经删除了故事板,因为我不想要它,这在我的 iPhone 上没问题。我是否需要检查(或做)更多事情才能使其在 iPad 上运行?

有关信息,这里是 AppDelegate 中的相关代码,以防它可能有用。

class AppDelegate: UIResponder,UIApplicationDelegate,   UNUserNotificationCenterDelegate,CLLocationManagerDelegate {
    var window: UIWindow?


    func application(_ application: UIApplication, 
        didFinishLaunchingWithOptions launchOptions:
        [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        window = UIWindow(frame: UIScreen.main.bounds)
        let navigatCtrlr = UINavigationController(), topVC = ViewController()
        navigatCtrlr.viewControllers = [topVC]
        navigatCtrlr.navigationBar.tintColor = UIColor.darkGray
        window!.rootViewController = navigatCtrlr
        window!.makeKeyAndVisible()
        .....

        return true
    }
    .....
}

此外,主故事板已从 Info.plist 中删除

标签: iosiphonexcodestoryboardipad-mini

解决方案


推荐阅读