【问题标题】:How can create one UITableview to multiple segue in storyboard?如何在情节提要中创建一个 UITableview 到多个 segue?
【发布时间】:2012-10-27 16:23:49
【问题描述】:

使用情节提要,我创建了一个包含七行的 UITableview,并为每行创建了七个 UIViewControllers。我想在选择特定行时导航到特定的 UIViewController。如何使用 Segue 方法导航 UIViewController?

我试了很多次,还是不行。

【问题讨论】:

    标签: iphone xcode


    【解决方案1】:

    您可以将您的UITableViewController 中的七个segue 连接到您的七个UIViewController。每个segue 设置一个唯一的identifier。然后在tableview:didSelectRowAtIndexPath:方法中,可以使用perfromSegueWithIdentifier:sender:方法来触发segue。

    【讨论】:

    • 好的,但是从 UITableviewcontroller 到 UIviewcontroller 只能创建一个 segue,其余的无法在情节提要中创建
    • 你不是在 storyboard 中创建了 7 个 UIviewcontroller 吗?
    • 那你为什么不能从 UITableviewcontroller 创建七个 segues 到它们?
    • 只有一个 segue 可以从 UITableview 创建到一个 UIViewcontroller 另一个 segue 从 UITableview 到 UIviewcontroller 不能创建。
    • @Surendhar 尝试从 UITableViewController 链接,但不要从单元格或 tableView 链接。通过单击 UITableViewController 的状态栏选择 UITableViewController,然后将其链接到 UIViewcontroller。然后重复七次。祝你好运!
    猜你喜欢
    • 2014-05-25
    • 1970-01-01
    • 1970-01-01
    • 2012-10-25
    • 2020-07-13
    • 2012-06-07
    • 2016-03-22
    • 2017-08-12
    相关资源
    最近更新 更多