Hi,
I ny Universal project, I create a popover using the following code:
This code occurs when an info button is pressed on my MainViewController.
Now, In my FlipsideViewController, I need to get the navigation controller to push the "DetailViewController" when an object is selected on the table view.
This is the code I am using:
However, when I select an object on the table view, the animation occurs, but just to a plain blue screen with the navigation controller. Why is pushViewController not changing the view, only the navigation controller?
Thanks,
ahan.tm
I ny Universal project, I create a popover using the following code:
Code:
FlipsideViewController *controller = [[[FlipsideViewController alloc] initWithNibName:@"FlipsideViewController" bundle:nil] autorelease];
controller.delegate = self;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
NSLog(@"iPhone");
navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:navController animated:YES];
[navController release];
[controller release];
} else {
if (!self.flipsidePopoverController) {
NSLog(@"iPad");
self.flipsidePopoverController = [[[UIPopoverController alloc] initWithContentViewController:navController] autorelease];
}
if ([self.flipsidePopoverController isPopoverVisible]) {
[self.flipsidePopoverController dismissPopoverAnimated:YES];
} else {
[self.flipsidePopoverController presentPopoverFromRect:[info bounds] inView:info permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];
}
}
This code occurs when an info button is pressed on my MainViewController.
Now, In my FlipsideViewController, I need to get the navigation controller to push the "DetailViewController" when an object is selected on the table view.
This is the code I am using:
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Create and push a detail view controller.
DetailViewController *detailViewController = [[DetailViewController alloc] initWithStyle:UITableViewStyleGrouped];
Child *selectedChild = (Child *)[[self fetchedResultsController] objectAtIndexPath:indexPath];
// Pass the selected book to the new view controller.
detailViewController.child = selectedChild;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
self.contentSizeForViewInPopover = CGSizeMake(320.0, 480.0);
MainViewController *sharedData = [MainViewController sharedMainViewController];
[self.navigationController pushViewController:detailViewController animated:YES];
}
However, when I select an object on the table view, the animation occurs, but just to a plain blue screen with the navigation controller. Why is pushViewController not changing the view, only the navigation controller?
Thanks,
ahan.tm