[dismissViewControllerAnimated:YES完成:无];不适用于iOS设备7 [英] [ dismissViewControllerAnimated:YES completion:nil]; not working for iOS device 7

查看:43
本文介绍了[dismissViewControllerAnimated:YES完成:无];不适用于iOS设备7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  [ dismissViewControllerAnimated:YES completion:nil]; 

不适用于ios7设备,但是对于模拟器来说可以正常工作.我知道这个问题已经被问到了,但是我没有找到答案.XCODE版本:6.1iPhone 4s ios7

Not working for ios7 device, but its working fine for simulator. I know this question is already asked but no answer i found there. XCODE version: 6.1 Iphone 4s ios7

- (IBAction)createThread:(id)sender {

  UIViewController *vc = [self presentingViewController]; //ios 5 or later
 [self dismissViewControllerAnimated:YES completion: nil];

  [[vc presentingViewController] dismissViewControllerAnimated:YES completion:nil];
 }

实际上,我想从3rd view controller转到1st view controller.它适用于模拟器,但在iPhone 3rd View Controller中消失了,但卡在2nd View Controller上,而不是第一个View Controller.

Actually i want to go to 1st view controller from 3rd view controller. It worked for simulator, but in iphone 3rd view controller is disappeared but it is stuck at 2nd view controller not going to first view controller.

推荐答案

如果您要从第3步转到第1步UIViewController,请尝试以下操作:

if you want to go to 1st UIViewController from 3rd try this:

[[[self presentingViewController] presentingViewController] dismissViewControllerAnimated:YES completion:nil];

这篇关于[dismissViewControllerAnimated:YES完成:无];不适用于iOS设备7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆