viewDidAppear not getting called

后端 未结 8 972
醉酒成梦
醉酒成梦 2021-01-12 00:17

In my main UIViewController I am adding a homescreen view controller as subviews:

   UINavigationController *controller = [[UINavigationController alloc] ini         


        
8条回答
  •  走了就别回头了
    2021-01-12 00:38

    Had a same problem My container view controller did retain a child view controller via a property, but did not add a child view controller to its childViewControllers array.

    My solution was to add this line of code in the container view controller

    [self addChildViewController: childViewController];
    

    After that UIKit started forwarding appearance methods to my child view controller just as expected

    I also changed the property attribute from strong to weak just for beauty

提交回复
热议问题