IOS:多个数组显示在单个 Tableview 上

标签 ios objective-c iphone uitableview

<分区>


想改进这个问题吗? 通过 editing this post 添加细节并澄清问题.

关闭 7 年前

在我的项目中,我有 2 个 UITableViews。 TableView 1 具有字段 - 医生、诊断、程序。 我只希望当我从 UITableView 1 选择 Physician 时,另一个 tableView2 UITableView 2 显示 Physician 的值。 像这样,当我从 UITableView 1 选择 Diagnose 时,另一个 tableView UITableView 2 显示 Diagnose 的值。 任何人都可以对此有任何想法。

最佳答案

您可以为两个表使用两个不同的委托(delegate),甚至可以为两个表使用相同的对象作为委托(delegate)。

在委托(delegate)方法 tableView:didSelectRowAtIndexPath: 检查 table=table1 并根据所选行更新 table2 的数据源并重新加载 table2。

关于IOS:多个数组显示在单个 Tableview 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34524198/

上一篇:ios - 无法触摸数组中的第二个元素

下一篇:ios - 对齐按钮和文本的最佳方式是什么?基本的,但由于网上的错误信息是必要的

相关文章:

ios - 支持 IOS4 & IOS 5 和 IOS6 的 Twitter 集成

ios - 加载 iOS 应用程序后更改 Root View Controller 。

ios - 不能强制应用程序在 iOS9 中仅纵向

html - 在 NSAttributedString 中转换 html 数据的时间太长。有任何想法吗?

iphone - TableView 在 "reloadData()"之后需要花费大量时间来刷新

iphone - 如何在 objective-c 中使在方法中创建的对象保持事件状态?

iphone - CAShapeLayer 绘制路径奇怪

ios - 将右栏按钮添加到导航栏的问题

ios - UIAlertController 显示 UIAlertActions 的空白标题

ios - 以编程方式更改按钮文本