gpt4 book ai didi

ios - 当前 View Controller nil key 错误

转载 作者:行者123 更新时间:2023-11-30 12:02:16 25 4
gpt4 key购买 nike

如果登录凭据已被验证,我试图让我的应用程序只继续屏幕,但由于某种原因,在继续时出现 fatal error 。以下是我遇到的错误:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil'
***

下面是我正在运行的代码:

if user!.isEmailVerified {
let vc = self.storyboard?.instantiateViewController(withIdentifier: "ProfileView") as! ProfileView
self.present(vc, animated: true, completion: nil)
}

打印segue之前的打印语句,但不打印其后的打印语句。

最佳答案

如果 View Controller 位于同一 Storyboard上,则创建 View Controller 实例并呈现它的方式是正确的。问题发生在其他地方,可能是异步的。确保 isEmailVerified 按预期工作。

关于ios - 当前 View Controller nil key 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47064706/

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