0

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 ?

1
  • Did any of our answers below helped? Please mark one as accepted. Commented Aug 24, 2011 at 11:39

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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];

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.