Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在视图控制器中有三个表视图(将显示/隐藏表视图以显示不同上下文中的选项列表)
只是想知道区分使用相同委托的不同表视图的最佳方法是什么。
谢谢
在视图控制器中使用三个单独的实例变量来存储表视图。然后在委托方法中,您可以执行以下操作:
if (tableView == myFirstTableView) { // Do whatever you need for table view 1. } else if (tableView == mySecondTableView) { // Do whatever you need for table view 2. }