I am porting my App from iOS3.2 to iOS6. On iPad, I use the SplitViewController.
In the RootViewController, I have got a table view. If the user clicks on a row in the table view, I change the DetailViewController.
The code doing this is:
- (void)setDetailViewAuthorPage {
UISplitViewController *splitViewController =
(UISplitViewController *)self.parentViewController.parentViewController;
UIViewController *detail =
[splitViewController.viewControllers objectAtIndex:1];
DetailViewControllerAuthorPageiPad <SubstitutableDetailViewController>
*detailViewController =
[[DetailViewControllerAuthorPageiPad alloc]
initWithNibName:@"DetailViewControllerAuthorPageiPad"
bundle:nil];
NSArray *viewControllers =
[[NSArray alloc]
initWithObjects:self.navigationController,
detailViewController,
nil];
splitViewController.viewControllers = viewControllers;
[detailViewController viewWillAppear:YES];
[viewControllers release];
// Dismiss the popover if it's present.
if (popoverController != nil) {
[popoverController dismissPopoverAnimated:YES];
}
[detailViewController
showRootPopoverButtonItem:self.rootPopoverButtonItem
root:self];
In the landscape orientation, this code works fine.
In the portrait orientation, the DetailViewController is not changed. The row gets selected and the code above is running but no DetailViewController change can be seen. (I am using the Xcode 4.5)
You help is much appreciated!
Thank you.