Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change DetailViewController on fly? #54

Open
Stan92 opened this issue Jan 26, 2012 · 1 comment
Open

change DetailViewController on fly? #54

Stan92 opened this issue Jan 26, 2012 · 1 comment

Comments

@Stan92
Copy link

Stan92 commented Jan 26, 2012

Hi,
this is not an issue... :)
but I can't figure out how to change the detailviewController.
From my masterview controller, I would like to change the detailViewController regarding the row pressed?
Any idea?

@johanneslagos
Copy link

You can do like this:

[mgSplitViewController viewWillDissapear:YES]

NSMutableArray *rootArray = [[mgSplitViewController.viewControllers objectAtIndex:0]viewControllers];
NSMutableArray *detailArray = [[mgSplitViewController.viewControllers objectAtIndex:1]viewControllers];

UIViewController *yourRootView = [UIViewController alloc]initWithFrame:...];
[rootArray addObject:yourRootView];
[mgSplitViewController.viewControllers objectAtIndex:0]setViewControllers:rootArray animated:NO];

UIViewController *yourDetailView = [UIViewController alloc]init];
mgSplitViewController.delegate = yourDetailView;
[detailArray addObject:yourDetailView];
[mgSplitViewController.viewControllers objectAtIndex=0]setViewControllers:detailArray animated:NO];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants