I have these delegate method for a tableview inside a class:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)ta
Yes you can do it with tag. Give your UITableViews the tags 1 and 2.
set up an switch:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil){
cell = [[[UITableViewCell alloc]initWithStyle:UITableViewStylePlain reuseIdentifier:CellIdentifier] autorelease] ;
}
switch ([tableView tag]) {
case 1:{
[[cell textLabel] setText:@"First tag"]
break;
}
case 2:{
[[cell textLabel] setText:@"Second tag"]
break;
}
default:
break;
}
return cell;
}