Kelvin
Kelvin

Reputation: 1172

quit app in iOS4

I have an old app which did many UI initialization work in viewDidLoad of various views. In iOS4 home button just put the app in background so viewDidLoad won't get called when re-launching the app.

I don't want to put those initialization procedures in viewWillAppear as it is unnecessary to re-initialize the data every time the view appear.

How can I completely quit my app when user press the home button? or any simple way to reload the view controllers that sit inside a tabBarController?

thanks.

Upvotes: 1

Views: 585

Answers (4)

nico
nico

Reputation: 1067

http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html

you have to look up to the UIApplicationDidBecomeActiveNotification i think, but in the uiapplicationdelegate-protocol, there are even some other interesting things for you

or perfectly for you: UIApplicationWillEnterForegroundNotification as a new notification in ios4 for this problem

Upvotes: 0

jayr parro
jayr parro

Reputation: 286

Try to check. UIApplicationExitsOnSuspend

Upvotes: 0

Sum
Sum

Reputation: 4399

Try disabling backgrounding. Apple has this in their documentation

Upvotes: 0

Jacob Relkin
Jacob Relkin

Reputation: 163268

There is a key in your app's Info.plist file called UIApplicationExitsOnSuspend, set it to the boolean YES, which will essentially revert the home button's functionality to pre-iOS4 and completely exit your app when the home button is tapped.

Upvotes: 9

Related Questions