Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6781029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:34:33+00:00 2026-05-26T16:34:33+00:00

I have taken a project based on the standard iPad SplitViewerController template and implemented

  • 0

I have taken a project based on the standard iPad SplitViewerController template and implemented recursive drill down navigation to any number of levels as follows:

Firstly I created a new view controller (named NavItemController) which I pop onto the controller stack in the didSelectRowAtIndexPath method of the RootViewController as follows:

NavItemController  *navItemController = [[NavItemController alloc] initWithNibName:@"NavItemController" bundle:[NSBundle mainBundle]];
navItemController.title = catalogue.name;
[[self navigationController] pushViewController:navItemController animated:YES];

I then use this view controller for all navigation up and down my tree structure (so the RootViewController is now only used to show the initial root level of navigation i.e. items with no parent).

That all works nicely.

Now I am trying to update the label on the detail view (detailViewDescriptionLabel) when I select an item in the NavItemController. To do this I first added an outlet to my NavItemController:

@property (nonatomic, strong) IBOutlet DetailViewController *detailViewController;

and configured it in InterfaceBuilder by adding a view controller from the library to the Objects list, changing its class to DetailViewController and hooking up the the outlet that I found under File’s Owner.

At this point if I step through my code I find that it correctly sets the detailItem in my detail view to the object selected in my NavController – and it seems to correctly set the detailDescriptionLabel.text value to a value from this detailItem. However this is not reflected in the UI (it does still work if I do this from the RootViewController).

I’m guessing that I have not hooked something up correctly or missed a step somewhere – I am (obviously) pretty new to iOS – any pointers would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:34:34+00:00Added an answer on May 26, 2026 at 4:34 pm

    I ended up resolving my problem by creating my project from scratch using iOS 5 and the Master Detail template. I also selected to use the storyboarding feature.

    I was able to use the MasterViewController (same as RootViewController in earlier template) for my recursive navigation i.e. I did not need to create a separate view controller.

    The code in the MasterViewController didSelectRowAtIndexPath method ended up being:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        NSManagedObject *selectedObject = [[self fetchedResultsController] objectAtIndexPath:indexPath];
        self.detailViewController.detailItem = selectedObject; 
    
        NavItem *navItem = ((NavItem *) selectedObject);
        Catalogue *catalogue = nil;
        Document *document = nil;
    
        if (navItem.catalogue != nil) // Load child catalogues and documents
        {
            catalogue = [navItem catalogue];
            DataLoader *dataLoader =[(AppDelegate *)[[UIApplication sharedApplication] delegate] dataLoader];
            [dataLoader drillDownIntoNavItems:catalogue];
            UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle mainBundle]];
            MasterViewController  *controller = [storyBoard instantiateViewControllerWithIdentifier:@"master"];
            controller.managedObjectContext = self.managedObjectContext;
            controller.title = catalogue.name;
    
            [[self navigationController] pushViewController:controller animated:YES];
        } 
        else if (navItem.document != nil) // Load attachments
        {
            document = [navItem document];
            DataLoader *dataLoader =[(AppDelegate *)[[UIApplication sharedApplication] delegate] dataLoader];
            [dataLoader drillDownIntoNavItems:document];
            UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle mainBundle]];
            MasterViewController  *controller = [storyBoard instantiateViewControllerWithIdentifier:@"master"];
            controller.managedObjectContext = self.managedObjectContext;
            controller.title = document.name;
            [[self navigationController] pushViewController:controller animated:YES];
    
            // Display document in detail viewer
        }
    
        else // attachment
        {
            // Display attachment in popover
        }
    }
    

    Also important is the viewWillDisappear method in the MasterViewController:

    - (void)viewWillDisappear:(BOOL)animated
    {
        if ([self.navigationController.viewControllers indexOfObject:self]==NSNotFound) {
            // back button was pressed. We know this is true because self is no longer
            // in the navigation stack. 
            DataLoader *dataLoader =[(AppDelegate *)[[UIApplication sharedApplication] delegate] dataLoader];
            [dataLoader drillUpIntoNavItems];
        }
    
        [super viewWillDisappear:animated];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently taken on a project in which I need to integrate with
i have taken the default asp.net mvc template and customized to work for me.
I have a window-based project with two UITextField s to take input from the
So I've taken over a VB.net web application project from another developer and have
We have simple project which takes a number of messages from a number of
I'm sure you have all been there, you take on a project where there
I have a fully working Setup project within Visual Studio 2008 that takes inputs
For a small project I have to parse pdf files and take a specific
I have taken over a large code base and would like to get an
I have taken a copy of a database home with me so I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.