我有一個UITableViewController
動態行,對於每一行,我需要打開一個新的viewcontroller
。 我試過使用performSegueWithIdentifier
,但它不起作用,因爲我沒有故事板標識符。performSegueWithIdentifier without storyboard idendentifier
如何動態打開新的viewcontroller
?
我已經試過:
newUiViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"controller"];
[self.navigationController pushViewController:controller animated:YES];
,但它不工作。
有在故事板稱爲「控制器」一個UIViewController有用嗎? – Ilario 2015-04-02 12:31:47
當它不起作用時會發生什麼?任何錯誤消息或堆棧跟蹤?你有沒有檢查'控制器'是否爲零? – clearlight 2015-04-02 12:32:40
錯誤消息是:「原因:'故事板()不包含標識符爲'controller'的視圖控制器」 –
user3576455
2015-04-02 12:44:25