![](/img/trans.png)
[英]UIViewController will not segue to another UIViewController?
[英]Perform Segue from another UIViewController
我在主視圖中的側面菜單中使用了SWRevealViewController庫。 我試圖從主視圖(帶有導航欄的一個我想要傳遞到下一個視圖)執行選擇,而不是從后視圖(帶有菜單表的那個)執行選擇,所以我試圖執行一個使用該視圖控制器而非“自己”進行搜索。 但是,我收到一條錯誤消息,說帶有標識符的segue不存在(確實存在)。
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
switch indexPath.row {
case 0:
print("case 0")
ViewController().goToView("to_playlist")
break
default:
break
}
}
class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UITableViewDataSource, UITableViewDelegate {
func goToView(a: String) {
performSegueWithIdentifier(a, sender: self)
}
}
有人可以讓我知道我該怎么做嗎?
謝謝。
不要忘記從StoryBoard設置標識符:
//objc code
SettingsController *view = [[SettingsController alloc] init];
view.blahBlah = self.blah;
[self.navigationController pushViewController:view animated:YES];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.