In IOS 4.x or lower, viewDidAppear method is not getting called while adding subview to a view, why?

后端 未结 2 1865
暗喜
暗喜 2021-01-17 16:08

In iOS 4.x or lower, viewDidAppear and viewWillAppear, viewDidDisappear and viewWillDisappear, such ViewController\'s delegate methods are not getting called. The same metho

2条回答
  •  独厮守ぢ
    2021-01-17 17:12

    For IOS4.x i use the UINavigationController delegate methods like this:

    -(void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
        if (SYSTEM_VERSION_LESS_THAN(@"5.0")) {
            [activeView viewDidAppear:YES];
        }
    }
    -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
        if (SYSTEM_VERSION_LESS_THAN(@"5.0")) {
            [activeView viewWillAppear:YES];
        }
    }
    

    I hope this helps!

提交回复
热议问题