gpt4 book ai didi

ios - Xcode 更新到 7.3 后断言失败

转载 作者:行者123 更新时间:2023-11-29 01:07:19 29 4
gpt4 key购买 nike

我将我的 Xcode 更新到 7.3。在更新之前,我能够在出现任何错误或崩溃的情况下运行我的代码。更新后,当我在 iPhone 上运行以下代码时出现断言错误(有趣的是在模拟器上没有错误)。

let storyboard =  UIStoryboard(name: storyboard, bundle: nil)
self.window?.rootViewController = storyboard.instantiateInitialViewController() as UIViewController!

错误

2016-03-24 16:15:25.891 Zilingo[434:92251] *** Assertion failure in -[UIStoryboard instantiateViewControllerWithIdentifier:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3512.60.7/UIStoryboard.m:171
error: Execution was interrupted, reason: breakpoint 5.1.
The process has been returned to the state before expression evaluation.

我是否遗漏了更新的某些步骤?

最佳答案

Try to this format:-   

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

// get your storyboard
let storyboard = UIStoryboard(name: "Main", bundle: nil)

// instantiate your desired ViewController
let rootController = storyboard.instantiateViewControllerWithIdentifier("MyViewController") as! UIViewController

// Because self.window is an optional you should check it's value first and assign your rootViewController
if let window = self.window {
window.rootViewController = rootController
}

return true
}

关于ios - Xcode 更新到 7.3 后断言失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36198111/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com