[英]Button Activated Segue Not Being Called
我有一個奇怪的問題。 我有兩個由表視圖控制器中的按鈕觸發的命令,這是導航控制器的根視圖控制器。 一種選擇會觸發,而另一種則不會。 它們來自兩個不同的按鈕,帶有兩個不同的標識符。
我在prepare(for segue: UIStoryboardSegue, sender: Any)
放置了一個斷點prepare(for segue: UIStoryboardSegue, sender: Any)
並且可以驗證第二個按鈕沒有調用它。 任何想法,將不勝感激。
我的代碼是:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "locationViewSegue", let destinationViewController = segue.destination as? LocationViewController {
destinationViewController.delegate = self
destinationViewController.weatherData = self.weatherData
destinationViewController.wxObservationStationsArray = self.wxObservationStationsArray
destinationViewController.newCoordinates = self.weatherData.locationCoordinates
} else if segue.identifier == "searchPriorLocations", let destinationViewController = segue.destination as? SearchBarTableViewController {
destinationViewController.priorForecastLocations = self.priorForecastLocations
}
}
任何想法,將不勝感激。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.