gpt4 book ai didi

ios - 如何呈现 UICollectionViewController?

转载 作者:行者123 更新时间:2023-11-30 12:19:04 26 4
gpt4 key购买 nike

我收到错误:

fatal error: unexpectedly found nil while unwrapping an Optional value

didTapUserScreenButton()不过工作正常,didTapChatControllerButton()给出错误。我认为它可能会出现错误,因为 didTapChatControllerButton()转到UiCollectionViewController?另一个工作正常,因为它会转到 UITableViewController? .

func didTapChatControllerButton() {
let chat_log_controller = ChatLogController
let navController = UINavigationController(rootViewController: chat_log_controller!)
present(navController, animated: true, completion: nil)

}


func didTapUserScreenButton() {
let user_screen_vc = usersScreenVC()
let navController = UINavigationController(rootViewController: user_screen_vc)
present(navController, animated: true, completion: nil)

最佳答案

您错过了(当前为空)初始化参数支架。尝试使用 tris:

let chat_log_controller = ChatLogController()
let navController = UINavigationController(rootViewController: chat_log_controller)
present(navController, animated: true, completion: nil)

关于ios - 如何呈现 UICollectionViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45034641/

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