gpt4 book ai didi

ios - 从 XIB 加载的 UITableViewCell 定义 Storyboard segue

转载 作者:行者123 更新时间:2023-12-01 17:06:31 24 4
gpt4 key购买 nike

我有一个 UITableViewController Storyboard 中的子类,它从 UITableViewCell 加载它的单元格在 XIB 文件中定义(这样做是为了在 TableView Controller 的深层层次结构中重复使用自定义单元格)。

我需要定义从这个 TableView Controller 到下一个 TableView Controller 的 segue。通常,您可以通过控制从源单元格拖动到目标的 View Controller 来执行此操作。但是由于源 TableView Controller 中没有原型(prototype)单元格,因此无法连接segue。

我是否必须求助于实现 -tableView:didSelectRowAtIndexPath:在我的 TableView Controller 中并触发手动转场?或者,还有更好的方法?

最佳答案

是的,展示新的 UIViewController来自 -tableView:didSelectRowAtIndexPath: .由于您没有原型(prototype)单元,因此您无法将 segue 与之链接。只需 -presentViewController:animated: .

关于ios - 从 XIB 加载的 UITableViewCell 定义 Storyboard segue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30117888/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com