How to use 2 UITableView in a UIViewController?

后端 未结 5 738
刺人心
刺人心 2021-01-14 01:33


Plz guide that how can i use 2 UItableView(or more) in a UIViewController & manage their
numberOfRowsInSection,......& other methods.
Any ideas for that

5条回答
  •  礼貌的吻别
    2021-01-14 02:22

    // tableView parameter is the tableView for which the delegate method is called
    // u can compare this with your table view references
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
        if (tableView == myTableView1) {
            // return data for myTableView1
        } else if (tableView == myTableView2) {
            // return data for myTableView2
        }
    }
    

提交回复
热议问题