开发者

TableView open´s splitview view´s

开发者 https://www.devze.com 2023-03-09 22:52 出处:网络
Hi anybody can explain of how to show a splitview when I tap a row from a cell?? or a tutorial of it?? I have a tableview, and i want to display information about that cell in a开发者_开发问答 splitv

Hi anybody can explain of how to show a splitview when I tap a row from a cell?? or a tutorial of it??

I have a tableview, and i want to display information about that cell in a开发者_开发问答 splitview.

Thanks


I don't think there's a tutorial for that, since you're not supposed to do that.

The split view controller is supposed to be the root view controller of your application, so if you want a pushable split view controller you'll have to write it yourself (or possibly find an open source one).


I want to implement an app that when it press a row from a table, it will open a splitviewcontroller that show the information about the selected cell in the "detail´s splitview" , and all the info of the table in the "rootview".

I have copy to my project the

  • DetalviewController.h/m
  • RootViewController.h/m
  • DetailView.Xib

files from the splitview template.

And add this code to my tableviewcontroller:

  • (void)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
0

精彩评论

暂无评论...
验证码 换一张
取 消