我有一个带有 2 个 subview 的自定义 UIViewController“ProfileController”——最重要的是一个嵌入了 UITableViewController 的容器 subview 。我如何从“ProfileController”中访问 UITableViewController,以便我可以动态配置我用来显示用户配置文件信息的“静态”单元格。
我不想使用独立的 UITableViewController,因为那样我就无法向配置文件屏幕的 UI 添加额外的自定义项。谢谢!
...不幸的是,我无法在 Storyboard中为标准 UITableView 设计静态单元格,因为我发现 Apple 的静态单元格实现与 UITableViewController 紧密耦合。真可惜。
最佳答案
在您的 ProfileController
覆盖中:
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!){
if segue.identifier == "whateverYouNamedTheEmbedSegue"{
myTableViewController = segue.destinationViewController as UITableViewController
}
}
关于ios - 如何访问嵌入在容器 View 中的tableviewcontroller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23169984/