Is there a way out or can anyone point me to a link, I am looking out for changing the contents of RootViewController in a SPLITVIEW of IPAD upon selection of any button in detailViewController ?
2 Answers
You can simply replace the VC at index 0 of the UISplitViewController's viewControllers property. Try something like-
-(void) buttonPressed: (id)sender
{
NSMutableArray* arr = [[NSMutableArray alloc] initWithArray:splitVC.viewControllers];
[arr replaceObjectAtIndex:0 withObject:myReplacementVC]; //index 0 corresponds to the left VC
splitVC.viewControllers = arr;
[arr release];
}
HTH,
Akshay
Comments
SplitViewController's content could be changed like this:
UISplitViewController * splitViewController = [[UISplitViewController alloc] init];
splitViewController.viewControllers = [NSArray arrayWithObjects:viewControllerLeft, viewControllerRight, nil];
// the other stuff
// change left part of view controller
splitViewController.viewControllers = [NSArray arrayWithObjects:newViewController, viewControllerRight, nil];