我有两个视图控制器以模块方式呈现.
A presents B which presents C.
当我解雇C的时候,我也想解雇B.但我不知道该怎么做:
C:
[self dismissModalViewControllerAnimated:YES]
//[delegate dismissB] //this doesn't work either when i create a delegate pattern
现在我只剩下B了.我怎样才能把B从C中剔除呢?
我有两个视图控制器以模块方式呈现.
A presents B which presents C.
当我解雇C的时候,我也想解雇B.但我不知道该怎么做:
C:
[self dismissModalViewControllerAnimated:YES]
//[delegate dismissB] //this doesn't work either when i create a delegate pattern
现在我只剩下B了.我怎样才能把B从C中剔除呢?
try 使用B中的下一个代码(就像你已经做的那样,在go 掉C之后):
[self.parentViewController dismissModalViewControllerAnimated:YES];
IMPORTANT:
Don't do anything in the method after this line.
This view controller (B) probably will be released and deallocated...
更新:
[self.parentViewController dismissViewControllerAnimated:YES completion:^{ /* do something when the animation is completed */ }];