我目前正在嘗試發送myslideMenuVC到我的ProfileVC點擊一個單元格。我將用Storyboard標識符來實例化ProfileVC,但我已經從我的LoginVC中獲得了此視圖控制器的segue。你是否大聲在一個視圖控制器上有2個segues?如果是的話,爲什麼不這樣做segue工作,因爲我收到此錯誤:終止與類型NSException的未捕獲的異常,由於未捕獲異常'NSInvalidArgumentException'終止應用程序,原因:'Storyboard()不包含帶標識符的視圖控制器'profileFromSlideMenu''你可以有兩個從不同的視圖控制器Segising到一個視圖控制器Swift 3
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
//self.selectedPost(index: 0)
if indexPath.row == 0 {
if let myProfileVC = self.storyboard!.instantiateViewController(withIdentifier: "profileFromSlideMenu") as? Profile {
self.present(myProfileVC, animated: true, completion: nil)
}
}
if indexPath.row == 1 {
handleLogout(Any.self)
}
}
是的,你被允許這樣做。問題在於你沒有爲該特定視圖控制器設置標識符,或者在代碼中的標識符中存在拼寫錯誤。 –
視圖控制器有一個不同的ID,我完全忘了改變!感謝您的領導! –