I am trying to change the views in a splitview controller based upon clicking a button in a modalview (a person is selecting an option). I am using notifications to accomplish this:
When the button is clicked in the modal view, it issues a notice, then closes (dismisses) itself:
[[NSNotificationCenter defaultCenter] postNotificationName:@"launchProject" object:nil];
The DetailViewController inside the split view controller is listening for this notification, and switches out the views in the SVC
-(void)launchProject:(NSNotification *)notification { Project* secondDetail2 = [[Project alloc] initWithNibName:nil bundle:nil]; ProjectRootController* secondRoot2 = [[ProjectRootController alloc] initWithNibName:nil bundle:nil ]; self.splitViewController.viewControllers =[NSArray arrayWithObjects: secondRoot2, secondDetail2 , nil]; }
I don't understand why the views aren't switching out. Any advice on this will be welcome.