我的ViewController中有3个tableView,可不可以实现单独使用UITableViewDelegate方法?比如,可以分别对每个UITableView使用cellForRowAtIndexPath方法,但是不知道对每个tableView单独用numberOfRowsInSection或者numberOfSectionsInTableView有什么不同?可以实现吗?
在使用批量tableview时使用delegates
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
3条回答 默认 最新
Kill_it 2013-02-21 06:08关注可以啊
:D设置3个
UITableView变量,放在你的 ViewController.h 文件中:在你的 ViewController : UIViewController
{ UITableView* tableView1; UITableView* tableView2; UITableView* tableView3; }并且在你的 ViewController.m 中:
-(NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section { if (tableView == tableView1) { //Your code } if (tableView == tableView2) { //Your code } if (tableView == tableView3) { //Your code } }解决 无用评论 打赏 举报