UIAlertView disappears when app goes to background and come back to foreground
Asked Answered
P

2

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

Padegs answered 9/12, 2010 at 11:38 Comment(2)
I've just tried to do the same in my app, but the alert view is still there. Maybe you want to post some codes or something? (maybe the alert view delegate codes are the most important)Aegisthus
@Padegs Have you found any solution ?Archfiend
M
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.

Maje answered 17/11, 2011 at 4:23 Comment(1)
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 somewhereZink
Z
1

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

[theViewWhenYouAddedIt bringSubviewToFront:theViewWhenYouAddedIt.theAlert];

This worked for me I hope this helps someone

Zink answered 12/4, 2012 at 9:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.