ios - Setting `title` changes UINavigationController stack -


i've had code working fine this:

[self.navigationcontroller pushviewcontroller:subview animated:yes]; 

to push new view onto uinavigationcontroller stack, i've implemented functionality reloads content of view , updates title, have function this:

- (void)loadentries:(nsstring *)entriestoload {    //loading code    self.title = [entriestoload lastpathcomponent]; } 

this code set title fine, causes uinavigationcontroller lose main root view was. if comment code out works absolutely fine, set title when i'm push new view onto view stack , has been working fine. add strangeness if view child view of child view (root view -> child view -> child view) seems treat first child view root. i'm unsure why changing title have such impact on navigation stack.

there must confusion here. talking child view (which sub-view after being added) or child view controller? because:

[self.navigationcontroller pushviewcontroller:subview animated:yes]; 

is expecting uiviewcontroller's subclass , not uiview's subclass.


if want play subviews, can simply:

[self.view addsubview:mysubview];  

and change title of uinavigationcontroller.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -