I've had some code working fine with this:
[self.navigationController pushViewController:subView animated:YES];
To push a new view onto a UINavigationController
stack, however I've now implemented some functionality that reloads the content of a view and then updates the title, so I have a function like this:
- (void)loadEntries:(NSString *)entriesToLoad
{
//Loading code
self.title = [entriesToLoad lastPathComponent];
}
This code does set the title fine, however it causes the UINavigationController
to lose what the main root view was. If I comment that code out it works absolutely fine, currently I just set the title when I'm about to push the new view onto the view stack and that has been working fine. To add to the strangeness if the view is a child view of a child view so (root view
-> child view
-> child view
) it seems to treat the first child view as the root. I'm unsure why changing the title would have such an impact on the navigation stack.