【发布时间】:2020-09-02 07:53:53
【问题描述】:
@objc func handleGoToSearch() {
// present(UINavigationController(rootViewController: searchDisplayController()), animated: true, completion: nil)
performSegue(withIdentifier: "searchSegue", sender: nil)
}
我正在使用对 SearchViewController 的当前调用,但是 ib 插座在哪里为零,我感觉它与传递一个新实例有关,并且插座没有及时加载。 (我在其他地方读到的)。当我使用执行 segue 而不是错误时。
我想确切地知道发生了什么。我还认为可能 present() 不适用于情节提要,或者我传入了错误的值类型。
【问题讨论】:
-
present确实适用于故事板。确保 ViewController 的类(在故事板中)正确设置为 swift 类
标签: ios swift uistoryboardsegue iboutlet