//dismiss到根视图
- (void)dismissToRootViewController{
UIViewController *vc = self;
while (vc.presentingViewController) {
vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:nil];
}
//这种更有效

  UIViewController *vc =self.presentingViewController;

while (![vc isKindOfClass:[[UIApplication sharedApplication].keyWindow.rootViewController class]]) {

vc = vc.presentingViewController;

}

[vc dismissViewControllerAnimated:YES completion:nil];

     //dismiss到指定界面
UIViewController *vc =self.presentingViewController;
while (![vc isKindOfClass:[[UIApplication sharedApplication].keyWindow.rootViewController class]]) {
vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:nil];
  [self.navigationController popToRootViewControllerAnimated:YES];//pop到根视图
   for (UIViewController *controller in self.navigationController.viewControllers) {
if ([controller isKindOfClass:[WekeWordLockViewController class]]) {
WekeWordLockViewController *vc = (WekeWordLockViewController *)controller;
[self.navigationController popToViewController:vc animated:YES];
}
}

最新文章

  1. 浅谈利用SQLite存储离散瓦片的思路和实现方法
  2. gnu coreutils-8.25 for win32 static - Beta
  3. oracle undo回滚段详解
  4. 瀑布流布局——jquery
  5. [翻译]Primer on Cognitive Computing(认知计算入门)
  6. weedfs getsockopt: connection timed out
  7. android坐标
  8. java事务的处理
  9. ansible命令执行模块使用
  10. easyui源码翻译1.32--TreeGrid(树形表格)
  11. 杭州电 1372 Knight Moves(全站搜索模板称号)
  12. Rule Or WorkFlow
  13. hive Beeline plus HiveServer2简单使用
  14. Configuring Apache Kafka for Performance and Resource Management
  15. (一)java异常处理的几个问题
  16. open-falcon监控nginx
  17. python基础——函数
  18. Redis中的哈希(Hash)
  19. 拓展Scene视图——场景编辑Vector2/3
  20. c#发送短信

热门文章

  1. 21. Jmeter对数据库进行压力测试
  2. PAT_A1081#Rational Sum
  3. Codeforces 1191A Tokitsukaze and Enhancement
  4. jQuery 对象与 Dom 对象转化
  5. 剑指offer——51丑数
  6. li中下的a元素的字超出了li的宽度
  7. Redis数据结构之整数集合-intset
  8. ArcGis 字段计算器表达式(Field calculator expression).cal文件与标注表达式(label expression).lxp的实质及其编码方式、解析方法
  9. Ubuntu桌面突然卡住,图形界面无反应
  10. XOR linked list--- 异或链表