2012-04-05 52 views
0

我有三个的UIViewController:A,B,C开关的UIViewController在iOS中

我转到从A

我转到C B从乙

我怎样才能goBackTo从C A没有通过乙?

//in a.m 
B* b =[B alloc] init]; 
[self presentModalViewController:b animated:YES]; 
[b release]; 
//in b.m 
C* c=[C alloc] init]; 
[self presentModalViewController:c animated YES]; 
[c release]; 

回答

1

我实际上不确定这是否工作没有导航控制器。如果不是的话,可以延迟解雇b和c。

[self popToRootViewControllerAnimated:YES]; 

编辑:

如后所述,这是行不通的。在延迟内使用[self dismissmodalviewcontroller:animated:]做你想做的事。

+0

如果没有导航控制器,它将不起作用,因为它是来自UINavigationController类的方法。 – sooper 2012-04-05 15:41:13

+0

我预计。那么,他可以在延迟中使用[self dismissmodalviewcontroller:animated:]。 (不会拖延两者,因为它不能一次处理两次解散,而会忽略第二次解除) – 2012-04-05 15:43:20

+0

是的,现在我知道差异了,thx。 – haibarahu 2013-03-28 03:34:59

相关问题