【发布时间】:2014-01-04 13:50:40
【问题描述】:
我是 ios 编程新手。我有多个视图控制器。我首先显示 tableView 控制器,并且在它之前有一个导航控制器.. 我想根据所选单元格显示特定的视图控制器.. 我已将 tableView 控制器设置为 dynamic 和 原型 Cell 到 1 我已经从表连接到我的一个视图控制器名称 APP1ViewController 我还有另外两个控制器名称 APP2 和 APP3 .. 我如何连接它们以便在特定单元格特定的视图控制器上加载。 这是显示单元格的代码..目前我的表格中有一节和三行
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"AppCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
switch (indexPath.row)
{
case 0:
cell.textLabel.text = @"APP 1 ";
cell.detailTextLabel.text = @"Detail of App 1...";
break;
case 1:
cell.textLabel.text = @"App2";
cell.detailTextLabel.text = @"Detail of App 2 app...";
break;
case 2:
cell.textLabel.text = @"App3";
cell.detailTextLabel.text =
@"Detail of App 3...";
break;
default:
cell.textLabel.text = @"Unkown";
cell.detailTextLabel.text = @"Unknown";
break;
}
return cell;
}
【问题讨论】:
标签: ios uitableview uistoryboardsegue