iOS программа для использования нескольких UITableView в одном UIViewController
Я пытаюсь реализовать 3 таблицы в одной последовательности в раскадровке. Когда одна таблица выбрана, она будет скрывать представление с другой таблицей, а также еще одну. В следующем коде, который я использовал для одной таблицы, формат ячейки каждой таблицы отличается, и строки также различаются. Так, как я могу ДИФФЕРЕНЦИРОВАТЬ между каждой таблицей, кодируя, чтобы установить различное количество строк для каждой таблицы и так далее?
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 3;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell2";
UITableViewCell *cell1 = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell1==nil)
{
cell1=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
temp=[array objectAtIndex:indexPath.row];
UILabel *Label1 = (UILabel *)[cell1 viewWithTag:4];
Label1.text = temp.Title;
UILabel *Label2 = (UILabel *)[cell1 viewWithTag:6];
Label2.text = temp.Title;
UITextField *textfield1 = (UITextField *)[cell1 viewWithTag:5];
textfield1.text =temp.description;
UILabel *Label3 = (UILabel *)[cell1 viewWithTag:7];
Label3.text = temp.Title;
return cell1;
}
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
self.showlist=[[ShowList alloc]initWithNibName:@"ShowList" bundle:nil];
[tableView deselectRowAtIndexPath:indexPath animated:NO];
ShowlistIndex=indexPath.row;
_secondview.hidden=NO;
}