开发者

How to transition from table view to a split view

开发者 https://www.devze.com 2023-02-19 05:39 出处:网络
I cannot figure out how to create an application that starts off as a normal uitableview, and then when I click on a cell in that table view, it takes me to a uisplitview .. I really need to be able t

I cannot figure out how to create an application that starts off as a normal uitableview, and then when I click on a cell in that table view, it takes me to a uisplitview .. I really need to be able to do this. I know there is a template for UITableView and a separate one for UISplitView, but I need a way to combine the two, with the first view being the UITableView. Sorry if this is such a noob question, but I think if I can get this setup working开发者_如何学运维, I can figure out the rest.

Thank you very much.


You can use presentModalViewController:animated if you touch a cell of your tableview and put in your splitViewController.

A simplified code example for your tableViewController

- (void)tableView:(*)tableView didSelectRowAtIndexPath:(*)indexPath
{
    UISplitViewController *mySplitViewController = [[UISplitViewController alloc] init];

    [self presentModalViewController:mySplitViewController animated:YES];

    [mySplitViewController release];
}

Have a look at this tutorial, it demonstrates how a splitviewcontroller is used.

0

精彩评论

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