Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
619 views
in Technique[技术] by (71.8m points)

iphone - Popping ViewController doesn't call viewWillAppear when going back

Whenever I pop a view controller manually, viewWillAppear doesn't get called on the previous UIViewController that now appears.

These are 2 regular UIViewControllers. My application setup is like this:

- UINavigationController
   - UITabViewController with 5 UIViewControllers including UIViewControllerA
      -UIViewControllerA (When I get back here, viewWillAppear doesnt get called)
        -UIViewControllerB (I'm here, I want to pop to A)

I've tried calling viewWillAppear manually, but that doesn't help either. What could be wrong? My last resort will be popping B, and A, and then creating a new A, and pushing that, but that's only as a last resort(I assume this will work?)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You cannot have a UITabBarController "inside" of a UINavigationController. That's probably why some of the viewWillAppear methods aren't being called. Take a look here: Tab bar controller inside a navigation controller, or sharing a navigation root view


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...