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 push onto the controller stack in the didSelectRowAtIndexPath method of the RootViewController as follows:
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:
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.
Firstly I created a new view controller (named NavItemController) which I push onto the controller stack in the didSelectRowAtIndexPath method of the RootViewController as follows:
Code:
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:
Code:
@property (nonatomic, strong) IBOutlet DetailViewController *detailViewController;
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.
Last edited: