UINavigationBar back button disappears

2019-08-27 19:43发布

问题:

I have lost a lot of time with this weird error/bug.

I have 2 ViewControllers with navigationController and I move from the first to the second with pushViewController. But when I push second viewController, it shows up and also backButton on the navigation bar shows up. But this button disappear in a very short time (about half a second). Title of the first viewC is ok and it`s also on the back button (I can catch it in the time it is shown up).

Does anyone have a tip where could be the problem? I am lost in this time...

Thanks

回答1:

OK. I'm an idiot. A forgot that I clear content including title in my viewDidDisappear. So the conclusion for the future generations... "when you have problems with backBarButton - it's 99% error with the previous viewController's title or you are hiding that button somewhere"...