iphone how do I detect my app was pushed to background?
I had written an app for iPhone 3. The app 开发者_运维百科calls safari and while it does that it exits out. Next time when it is called it loads from scratch.
But with iPhone 4 this behavior has changed. I find that my app was in the same where I left it before I opened safari.
How do I exit my app while it is sent to background ? (iPhone 3 like behavior)
or is there any delegate that I can use to detect if my app has gone to background and again came to forground ?
thank you !
You can set a key in Info.plist
called UIApplicationExitsOnSuspend
to YES
.
You can implement applicationWillResignActive: which is called when an app is terminating or on iOS4 if it is going into the background.
精彩评论