7

I am developing an iPhone application (iPhone with multi tasking support) in which I am displaying UIAlertView on error. When UIAlertView is about to get display my app is sent to background. Now, if I try to get my app in the foreground, UIAlertView gets displayed for a moment and gets dismissed automatically even if I don't call dismiss/click on any button.

Does anyone knows what the problem is?

Thanks and Regards, Deepa

spd
  • 2,114
  • 1
  • 29
  • 54

2 Answers2

1

Rajact answer is good if by 'call' means the next

[theViewWhenYouAddedIt bringSubviewToFront:theViewWhenYouAddedIt.theAlert];

This worked for me I hope this helps someone

Oscar
  • 1,899
  • 1
  • 22
  • 32
1

When you add an alert view, it is added on top of the view of the current viewcontroller and while coming back to foreground , sometimes the view is reloaded from the xib and all the contents are refreshed. I suggest you to maintain a state variable in controller which calls the alertView again when coming back to foreground.

Rajat Talwar
  • 11,922
  • 1
  • 18
  • 12
  • The issue is happening to me as well, this is not possible cause the alert is appearing when i call to the next one, so, i guess is there somewhere – Oscar Apr 11 '12 at 09:21