Unless the user is in a moving vehicle, the current location shouldn’t change frequently enough to be an issue.
You can always start location services again later if you need another update.
The IALocation Manager class is central point for configuring the delivery of indoor location related events to your app.
You use and instance of this class to establish the parameters that determine when location events should be delivered and to start and stop the actual delivery of those events.
In the Mac app, this code lives in an in a Mac app.
We’re working on a location product right now and one of the little challenges along the way has been how to report background location updates back to our servers. We’re going to be using the Significant Location Changes feature introduced with i OS 4 as this is the recommended way of tracking the approximate device location in a low power way.
Both apps have a delegate that listens for updates and formats the location into HTML for the web view, strings labels for the buttons, and a Google Maps URL.
The code between these two apps is identical and is a good example of a violation of the Don’t Repeat Yourself, or DRY, Principle. Part of what makes this difficult is that it is highly coupled to the UI.
This is a follow-up to my post on why you should unit test Cocoa and i Phone applications.
Using location-based information in your app is a great way to keep the user connected to the surrounding world.