美文网首页
iOS 跳转到指定界面方法

iOS 跳转到指定界面方法

作者: 西门丨不吹雪 | 来源:发表于2017-02-23 17:20 被阅读523次

我们在做项目市经常遇到这样的需求:点击按钮跳转到购物车或者首页。方法如下:

self.tabBarController.selectedIndex = 0;//更改selectedIndex选择tabbar的选项
[self.navigationController popToRootViewControllerAnimated:YES];

或者

[self.navigationController popToRootViewControllerAnimated:YES];
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
appDelegate.window.rootViewController = [[TabBarViewController alloc]init];

相关文章

网友评论

      本文标题:iOS 跳转到指定界面方法

      本文链接:https://www.haomeiwen.com/subject/aembwttx.html