Screw Multitasking: How To Make Your iOS 4 Apps Exit For Real | iPhone, iOS 4, iPad SDK Development Tutorial and Programming Tips.

Multi-tasking can be great, but it has added some complexity to programming on the iPhone.  For many apps there really is no advantage. For instance, does the “That’s What She Said” button really need to stay in memory?

It’s some added complexity that programmers don’t need.. some of the more complex memory intensive apps will just exit anyways, and programming the app to suspend can be a highly complicated task.

Fortunately there is a simple way to make your iOS 4 apps terminate for real when the user taps the home button.

This is a simple process:

  1. Open your info.plist file
  2. Add The Key UIApplicationExitsOnSuspend or Select Application does not run in background
  3. Set the new key to YES or Fill in the tick box

Now your applicationwillterminate: method will be run when the user taps the home key, and your app will exit for real.

Leave a Reply

电子邮件地址不会被公开。 必填项已用*标注