In my modal view controller I have a button handling method that includes
[self dismissModalViewControllerAnimated: YES];
In the presenting view controller I override dismissModalViewControllerAnimated: as follows:
-(void) dismissModalViewControllerAnimated: (BOOL)animated
{
NSLog(@"dismiss");
[super dismissModalViewControllerAnimated: animated];
}
When the button is touched, the button handling method gets called, but the dismissModalViewControllerAnimated: override does not seem to get called: the NSLog(@"dismiss"); statement isn't called, and a breakpoint inside the method doesn't get hit.
I tried
[[self presentingViewController] dismissModalViewControllerAnimated: YES];
but that didn't work either. However, the modal view controller does get dismissed.
Any idea what might be going wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…