How can I remove a view from navigation controller

前端 未结 5 2066
不思量自难忘°
不思量自难忘° 2020-12-14 11:36

I want to call a new view controller and remove the current view controller from the navigation controller stack. For example. I am in view controller A and I call B.

<
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 12:31

    You can use this code.

    NSMutableArray *navigationArray = [[NSMutableArray alloc] initWithArray: self.navigationController.viewControllers]; [navigationArray removeAllObjects]; self.navigationController.viewControllers = navigationArray;

    Hope that will work for you.

提交回复
热议问题