0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSInteger rows;
if (tableView == self.tableView) {
rows = [self numberOfRowsInSectionDishes:section];
} else {
rows = [self numberOfRowsInSectionSearch:section];
}
return rows;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell;
if (tableView == self.tableView) {
cell = [self cellForRowAtIndexPathDishes:indexPath];
} else {
cell = [self cellForRowAtIndexPathSearch:indexPath];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (tableView == self.tableView) {
[self didSelectRowAtIndexPathDishes:indexPath];
} else {
[self didSelectRowAtIndexPathSearch:indexPath];
}
}
Genius!
Запостил:
stonerhawk ,
23.05.2014 (Updated 27.03.2018 )
Хотя, по "фэншую" должно быть либо два делегата, либо сравнение с self.secondTableView