开发者

UIAlertView disappears when app goes to background and come back to foreground

开发者 https://www.devze.com 2023-01-29 11:13 出处:网络
I am developing an iPhone application (iPhone with multi tasking support) in which I am displaying UIAlertView on error. When UIAlertV开发者_运维知识库iew is about to get display my app is sent to bac

I am developing an iPhone application (iPhone with multi tasking support) in which I am displaying UIAlertView on error. When UIAlertV开发者_运维知识库iew 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


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.


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

[theViewWhenYouAddedIt bringSubviewToFront:theViewWhenYouAddedIt.theAlert];

This worked for me I hope this helps someone

0

精彩评论

暂无评论...
验证码 换一张
取 消