0
我想從一個視圖,充滿數據從一個對象,到相同的視圖,但通過segue填充不同的對象。如何繼續使用我所在的UIViewController?
使用segue是非常必要的,因爲我們用戶需要在切換對象和刷新視圖時能夠返回到過去的視圖控制器。
例子: (ThisView,用的thisObject填充視圖) - >(ThisView,與thisOtherObject填充視圖)
我已經試過什麼:
presentView控制器:這並沒有因爲工作這不是我想要實現的默認搜索。
let next: NewClubProfile = storyboard?.instantiateViewControllerWithIdentifier("clubProfile") as! NewClubProfile
presentViewController(next, animated: true, completion: nil)
使用導航控制器:無法弄清楚如何Segue公司新的對象來填充其他視圖
let next: NewClubProfile = storyboard?.instantiateViewControllerWithIdentifier("clubProfile") as! NewClubProfile
self.navigationController?.pushViewController(next, animated:true)
在做第二種方法時你面臨什麼問題? –
第二種方法實際上是行得通的,我還在弄清楚如何將新對象添加到視圖控制器。如果你看看我在下面發佈的答案,你可以看到工作代碼。 – thoseguysintown