5

我有一个带有 2 个子子视图的自定义 UIViewController“ProfileController”——最重要的是一个嵌入 UITableViewController 的容器子子视图。如何从“ProfileController”中访问 UITableViewController,以便动态配置用于显示用户配置文件信息的“静态”单元格。

我不想使用独立的 UITableViewController,因为这样我就无法为配置文件屏幕的 UI 添加其他自定义项。谢谢!

...不幸的是,我无法在情节提要中为标准 UITableView 设计静态单元,因为我发现 Apple 的静态单元实现与 UITableViewController 紧密耦合。确实很糟糕。

4

1 回答 1

2

在您的ProfileController覆盖中:

override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!){
    if segue.identifier == "whateverYouNamedTheEmbedSegue"{
        myTableViewController = segue.destinationViewController as UITableViewController
    }
}
于 2015-04-09T18:52:23.393 回答