2011-05-31 83 views
0

嗨 任何人都可以解释如何显示拆分视图时,我从单元格中点击一行? 或它的教程?TableView open's拆分视图的

我有一个桌面视图,我想在分屏显示有关该单元格的信息。

谢谢

回答

0

我不认为有一个教程,因为你不应该这样做。

拆分视图控制器应该是你的应用程序的根视图控制器,所以如果你想你就会有一个被按压拆分视图控制器自己编写(或可能找到一个开源的一个)。

0

我想实现一个应用程序,当它从表中按下一行时,它将打开一个splitviewcontroller,显示关于“detail's splitview”中所选单元格的信息 ,以及表格的所有信息在“rootview”中。

我复制到我的项目

  • DetalviewController.h /平方米
  • RootViewController.h /平方米
  • DetailView.Xib从SPLITVIEW模板

文件。

而这个代码添加到我的tableviewcontroller:

  • (无效)的tableView:(UITableView的*)的tableView didSelectRowAtIndexPath方法:(NSIndexPath *)indexPath

{

//Initialize the controller. 

if(split == nil) 

split = [[RootViewController alloc] initWithNibName:@"split" bundle:[NSBundle mainBundle]]; 


//Pass the current row number to the sub view controller. 

    split.number = indexPath.row; 



    //here is my problem, i cant add the new view, and it crash 
[self.view addSubview:[split view]]; 

}

enter code here