我已經通過我的代碼幾次,我似乎無法找到答案。所以我有一個視圖控制器,並在該視圖控制器中,我有一個搜索欄。當我在搜索欄中輸入表格視圖時。表格視圖來自另一個稱爲ResultsViewController
的視圖控制器,並且搜索結果tableview被放置在搜索欄的正下方,這非常完美。如何設置導航欄
let locationSearchTable = UIStoryboard(name: "MainPage", bundle: nil).instantiateViewController(withIdentifier: "ResultsViewController") as! ResultsViewController
searchController = UISearchController(searchResultsController: locationSearchTable)
searchController?.searchResultsUpdater = locationSearchTable
但我的問題是,當我點擊表視圖的細胞,它塞格斯爲detailedViewController
,並失去其導航欄:
這是detailedViewController
檢查員屬性:
我不確定什麼是錯誤的,因爲我可以繼續從其他視圖控制器的detailedViewController
:
**當我在搜索欄鍵入一個表視圖來了**這的tableView怎麼來了?你使用presentViewController嗎? – Surjeet
@Krunal我更新了它 – juelizabeth
@Sjejeet沒有我使用的代碼在我的問題 – juelizabeth