左側に 1 つ、右側に 2 つ目の 2 つのテーブルを使用できます。tableview.tag = 2;
左側のテーブルの任意の行をクリックしながら、タグ = 2 でテーブル ビューをリロードするだけです。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (tableView.tag == 1)
return 5;
else if (tableView.tag == 2)
return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identifier = @"CellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
}
if (tableView.tag == 1)
{
///// Do whatever you want to do
}
else if (tableView.tag == 2)
{
///// Do whatever you want to do
}
cell.textLabel.text = @"example";
return cell;
}