7

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

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
Wak
  • 71
  • 3
  • Navigation controller on the iPad? – kennytm Feb 25 '10 at 20:36
  • Yes, its an iPhone app ported to the iPad, so I'm using the navigation controller, but I don't think that this is the case, the problem is that the viewWillAppear is not being called – Wak Feb 25 '10 at 20:44

3 Answers3

3

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.

Drew C
  • 6,408
  • 3
  • 39
  • 50
  • 1
    **"I rely on delegate methods to announce to the original view controller the actions of the modal view controller."** Can you please elaborate this? I am really confused.. – rohan-patel Mar 09 '12 at 12:24
0

Chances are it's a bug, I would file a bug report with apple here.

mmc
  • 17,354
  • 2
  • 34
  • 52
Matt S.
  • 13,305
  • 15
  • 73
  • 129
0

Based on guesswork, rather than reading, testing or anything useful really, but therefore not covered under the NDA...

Is viewWillDisappear being called when you presentModalViewController ? It may be that it doesn't think the modal view obscures the original view fully, therefore (unlike the iPhone) both exist at once ?

Andiih
  • 12,285
  • 10
  • 57
  • 88