views:

18

answers:

2

How to dismiss the alert view (and execute its cancellation handler) when my application moves back to the foreground or my refference object is not available? If any one knows please reply. Thanks in advance..!

A: 

I don't think there is a way. You need to keep a reference and subscribe to the UIApplicationDidEnterBackgroundNotification notifications. When you get that message you can call the dismissWithClickedButtonIndex:animated: which, as the documentation says, "in iPhone OS 4.0, you may want to call this method whenever your application moves to the background."

Stephen Darlington
wheather UIApplicationDidEnterBackgroundNotification gets called when one of UIViewController gets into background and that may be released at background process?
Mahesh