使用presentModalViewControllerAnimated方法从A->B->C,若想在C中直接返回A,则可这样实现:
C中返回事件:
01.
void
back
02.
03.
{
04.
05.
[
self
dismissModalViewControllerAnimated:
NO
];
//注意一定是NO!!
06.
07.
[[NSNotificationCenter defaultCenter]postNotificationName:@\
"backback\"
object:
nil
];
08.
09.
}
-
然后在B中:
01.
//在viewdidload中:
02.
03.
[[NSNotificationCenter defaultCenter] addObserver:
self
selector
:@
selector
(back) name:@\
"backback\"
object:
nil
];
04.
05.
06.
07.
-(
void
)back
08.
09.
{
10.
11.
[
self
dismissModalViewControllerAnimated:
YES
];
12.
13.
}