$39.99 (as of April 26, 2018, 3:09 am)
& FREE Shipping.
Usually ships in 24 hours
Anyone with programming experience can learn how to write an iPhone app. But if you want to build a great app, there’s a lot more to it than simple coding: you also need to know how design and market your creation. This easy-to-follow guide walks you through the entire process, from sketching out your idea to promoting the finished product.
Update Your App for Multitasking with iOS 4
By Craig Hockenberry
On multitasking phones like the iPhone 3GS and iPhone 4, you can make it so your application doesn’t quit when the user presses the Home button. Instead, the app just goes into the background and reappears just as it was with a tap on its icon. You can give your app multitasking powers without writing a single line of code!
First, download and install the free iOS 4 SDK from Apple’s iPhone Dev Center. You need both Xcode 3.2.3 and iPhone SDK 4 to create an app for iOS 4. (By the way, you may see the SDK described as either “iOS SDK” and “iPhone SDK.” They mean the same thing.)
Now you’re just a few steps away from a multitasking app:
2. In the General tab, change the Base SDK for All Configurations from “iPhone Device 3.0 (missing)” to “iPhone Device 4.0.”
3. In the Build tab, set the Configuration to “Release” and enter a search for “target.”
You should now see the following:
Now you can build your app in the usual way and test it on an iPhone.
You may want to make one further refinement, since the iPhone may terminate multitasking apps when the OS or another app needs more memory. To reduce the chances of your app getting purged from memory, clear out any caches or other data that can easily be reconstructed. Luckily, the system notifies your app when it puts the app into the background: that’s your chance to clear out this temporary memory. It’s also a good time to save any state or other information that you’ll use the next time your application is launched. You can capture the notification in one of two ways: through a – applicationDidEnterBackground: method in your application delegate or by registering for the UIApplicationDidEnterBackgroundNotification in your view controllers. If you’re saving application-wide information, the delegate is the best choice. If you need to keep some of your controller’s model data, the notification is usually easier. You can use both techniques if necessary.
For more information on multitasking in iOS 4, check out “Supporting Multitasking In Your Applications” in the iPhone Dev Center.