viewDidDisappear not getting called on a UINavigationController

前端 未结 4 847
无人及你
无人及你 2021-01-27 20:25

I\'m having a problem with my navigation controller. If I add a view controller to the stack:

- (void) tui_ToggleListStudy:(id)sender
{
    listVC = [[ListViewCo         


        
4条回答
  •  不思量自难忘°
    2021-01-27 20:37

    Assuming your navigation controller is contained in some kind of top view controller, you must also forward the relevant messages from that top view controller to the nav controller:

    -(void)viewWillAppear:(BOOL)animated
    {
        [navController viewWillAppear:animated];
    }
    
    -(void)viewDidAppear:(BOOL)animated
    {
        [navController viewDidAppear:animated];
    }
    
    -(void)viewWillDisappear:(BOOL)animated
    {
        [navController viewWillDisappear:animated];
    }
    
    -(void)viewDidDisappear:(BOOL)animated
    {
        [navController viewDidDisappear:animated];
    }
    

提交回复
热议问题