Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试设置应用内购买,一旦购买完成,我需要将应用重置为其初始启动状态。我想知道是否有办法释放每个导航控制器内的所有视图控制器并重新加载应用程序启动时显示的初始视图。
提前致谢!
你可以
[self.navigationController setViewControllers:nil animated:NO];
(可能有效,尽管未经测试)但是使用它可能更有用:
[self.navigationController popToRootViewControllerAnimated:NO];
跟踪导航控制器并恢复起始视图取决于您。