Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fbartolom

macrumors newbie
Original poster
Jan 29, 2014
4
0
I am having a problem with my iPad app in dismissing view controllers in the master detail. When I try to pop them up just the title gets popped, while the table remains there. If I push another view controller again the title is updated but the table remains the old one. If finally I refresh the table by pulling it down, lo and behold, the new table surfaces. Logging the view controllers evolution in the navigation controller nothing strange shows up: upon popping up the navigation controller just owns the root view controller. I am really stuck as it seems my popping up has no effect on the view controller content.

Thanks in advance
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
I am having a problem with my iPad app in dismissing view controllers in the master detail. When I try to pop them up just the title gets popped, while the table remains there. If I push another view controller again the title is updated but the table remains the old one. If finally I refresh the table by pulling it down, lo and behold, the new table surfaces. Logging the view controllers evolution in the navigation controller nothing strange shows up: upon popping up the navigation controller just owns the root view controller. I am really stuck as it seems my popping up has no effect on the view controller content.

Thanks in advance

You need to provide a LOT more information.

What is the structure of your app? Is the root of all your view controllers a navigation controller? What is its root view controller?

What is the code that pushes other view controllers, and what is the code the does the popping?

Are you using storyboards or nib files?
 

fbartolom

macrumors newbie
Original poster
Jan 29, 2014
4
0
You need to provide a LOT more information.

What is the structure of your app?
Sure, the iPad project is a simple SplitViewController and the "unpoppable" controllers are on the master part. You may have a look yourself at the storyboard at:
http://www.inarrivo.net/uk/storyboards/
Is the root of all your view controllers a navigation controller? What is its root view controller?
The master view controller has its own navigation controller on which I push the new controllers and from which I would like to pop them up.
What is the code that pushes other view controllers, and what is the code the does the popping?
The pushing is done through the storyboard while the popping up is done with the following piece of code:
Code:
- (void) dismissView:(id)sender {
		// Call the delegate to dismiss the modal view
    inArrivoHDAppDelegate* appDelegate = (inArrivoHDAppDelegate*)[[UIApplication sharedApplication] delegate];
    NSLog(@"controllers %@", appDelegate.rootViewController.navController.viewControllers);
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
        [appDelegate.rootViewController.navController popViewControllerAnimated:YES];
    } else {
        [self.navigationController popViewControllerAnimated:YES];
    }
    NSLog(@"after count %ld", (unsigned long)[appDelegate.rootViewController.navController.viewControllers count]);
    NSLog(@"controllers %@", appDelegate.rootViewController.navController.viewControllers);
}
The root controller is loaded in the appDelegate with:
Code:
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
        splitViewController = (UISplitViewController *)self.window.rootViewController;
        UINavigationController *navigationController = [splitViewController.viewControllers objectAtIndex:0];
        rootViewController =(RootViewController*)[navigationController topViewController];
        rootViewController.navController=navigationController;
        detailViewController=(inArrivoHDDetailViewController*)[splitViewController.viewControllers lastObject];
        splitViewController.delegate = (id)navigationController.topViewController;
        detailViewController.delegate=(UITableViewController*)navigationController.topViewController;
        navigationController.navigationBar.barStyle=UIBarStyleBlack;
    }
Are you using storyboards or nib files?
The formers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.