Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad viewWillAppear and presentModalViewController problems

In the iPhone, I have a tableview, and touching the cells, I have one method calling presentModalViewController, and opening another view, with email and this kind of stuff. When the user press the cancel button, the viewWillAppear method in the previous view is called. So far, so good. But in the iPad, the viewWillAppear is only called the first time that the view appears, anyone knows if this is a bug or it's right? I tried to implement the

- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{

with no success.

Does anybody know how to fix this without doing any delegate method from scratch? Thanks in advance

like image 987
Wak Avatar asked Feb 25 '10 20:02

Wak


1 Answers

Since view controllers presented modally don't necessarily completely cover up the underlying view on iPad, the viewWillAppear method does not fire when said modal view controllers get dismissed. I rely on delegate methods to announce to the original view controller the actions of the modal view controller. I think it's the best way to go.

like image 148
Drew C Avatar answered Oct 19 '22 04:10

Drew C