1

I'm searching any tutorial or explication how to add a "level" in a table-view.

I'm using XCode 4.3.2. I've created a Master-Detail App, and I did all what I should for a working application. But I have only one Level in my table view, and have absolutely no idea how to get a second level.

I searched a lot in Google and in the Apple documentation, but I haven't found anything..

My wish is to have the list, when you click on an object of the list, you go to the second level with a new list, and when you click on an object of the second list, it changes the Detail View.

4

1 回答 1

3

我认为您的意思是转到下一个视图控制器。你应该做的是使用委托方法- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath链接到文档

这里可以新建一个tableViewController,例如

UITableViewController *newTable = [[UITableViewController alloc] initWithStyle:UITableViewStylePlain];
[self.navigationController pushViewController:newTable animated:YES];

但是,您想要做的(我猜)是向它发送应该显示的数据。因此,在您的 newTable tableviewcontroller 中,您应该创建一个新的 init 方法,该方法允许您发送所需的数据。例如一个数组。然后该类可以处理该数据并根据需要显示它。

我希望这回答了你的问题。

于 2012-05-01T11:53:06.457 回答