【问题标题】:willFinishLaunchingWithOptions not calledwillFinishLaunchingWithOptions 未调用
【发布时间】:2017-05-29 12:04:01
【问题描述】:

我的应用程序有一个应用程序委托,我已将代码放入其中,我需要在委托中的以下方法下在那里:

func application(_ application: UIApplication,
                          willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool{
    let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
    let initialFrontViewController: ViewController2 = storyboard.instantiateViewController(withIdentifier: "initialFrontRevealController") as! ViewController2
    let revealController: RevealViewController = storyboard.instantiateViewController(withIdentifier: "revealVC") as! RevealViewController
    revealController.setFront(initialFrontViewController, animated: true)

    print("seen command")

    return true
}

我的问题是我的打印语句没有打印到控制台,并且当我构建和运行我的应用程序时,我在方法中放置的任何任务都没有真正生效。

到目前为止,我已经尝试了几次内容和设置重置,但都无济于事。任何帮助将不胜感激。

【问题讨论】:

  • 我认为您在打印语句之前也有一些错误,但您没有说。否则打印语句不可能不打印。就像您因为使用 as! 进行的强制解包而导致崩溃一样

标签: ios swift3 swrevealviewcontroller


【解决方案1】:

将代码"print("seen command")"更改为fund中的第一行

application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool

观察是否有打印日志,Out of the current methods can not run code错误。

【讨论】:

    猜你喜欢
    • 2020-12-18
    • 1970-01-01
    • 1970-01-01
    • 2018-05-01
    • 1970-01-01
    • 2018-01-09
    • 2014-05-30
    相关资源
    最近更新 更多