Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/116.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 获取modal segue的sourceViewController_Ios_Objective C_Segue - Fatal编程技术网

Ios 获取modal segue的sourceViewController

Ios 获取modal segue的sourceViewController,ios,objective-c,segue,Ios,Objective C,Segue,在prereforsegue:之后,我是否可以获取模态序列的sourceViewController [UINavigationController] |-[ViewControllerA]-------\ |--(modal)--> [UINavigationController]-[ViewControllerC] [UINavigationController] | |-[ViewControllerB]---

prereforsegue:
之后,我是否可以获取模态序列的
sourceViewController

[UINavigationController]
  |-[ViewControllerA]-------\
                             |--(modal)--> [UINavigationController]-[ViewControllerC]
[UINavigationController]     |
  |-[ViewControllerB]-------/
完成
ViewControllerC
后,我想执行
sourceViewController
的展开顺序

我编写了以下代码,但它不起作用

    if ([self.presentingViewController isKindOfClass:[ViewControllerA class]]) {
        [self performSegueWithIdentifier:@"UnwindToViewControllerA" sender:self];
    } else if ([self.presentingViewController isKindOfClass:[ViewControllerB class]]) {
        [self performSegueWithIdentifier:@"UnwindToViewControllerB" sender:self];
    }

有什么解决方案吗?

尝试用
self.navigationController.presentingViewController
代替
self.presentingViewController
“它不工作”没有多大帮助。你的代码给出了什么结果?您是否尝试记录self.presentingViewController?
self.presentingViewController
是SWRevealViewController和
self.navigationController.presentingViewController
nilIs ViewController-C是navigationController的实例,还是navigationController的rootViewController?