shajem
shajem

Reputation: 2121

Close the application when it goes to the background

When the application is sent to the background, i need the application to shutdown completely. Presently, when my app goes to the background, and when i call it back it shows the view i was working before it went to the background.

I am doing this to release memory.

How can i do this programatically ?

Upvotes: 3

Views: 168

Answers (3)

sch
sch

Reputation: 27506

Do not prevent your app from multitasking just because you have memory issues. What you should do is optimize your code and correct these issues.

Look at this guide and the methods that it mentions, they will allow you to know if your application is going to the background for example so that you can release some memory.

Upvotes: 2

Ashraf
Ashraf

Reputation: 2632

Go to your configuration (e.g plist file) and add the following tag : UIApplicationExitsOnSuspend and set it to true

Upvotes: 3

Shubhank
Shubhank

Reputation: 21805

Add a key UIApplicationExitsOnSuspend to YES on info.plist

More info here

https://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html

Upvotes: 4

Related Questions