Uitablecell推入不同的笔尖

时间:2011-02-28 06:39:57

标签: iphone cocoa-touch

您好我正在尝试将不同的nibfiles推入视图中 当您单击它对应的uitablecell时。 我不知道从哪里开始。

1 个答案:

答案 0 :(得分:2)

阅读UITableView类和基于导航的应用程序并查看此代码

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

  //and code like this

   if(indexPath.row==0)
   {
     FirstController *objFirstController=[[[FirstController alloc] initWithNibName:@"FirstView" bundle:nil] autorelease];
[self.navigationController pushViewController:objFirstController animated:YES];
   }
else
{
   SecondController *objSecondController=[[[SecondController alloc] initWithNibName:@"SecondView" bundle:nil] autorelease];
[self.navigationController pushViewController:objSecondController animated:YES];
 }
}