iPhone: CLLocation: Get current location

Steps to basic geolocation:

1. Add CLLocation framework to Build Phases, Link Binary with Libraries

2. Set up instance variable in .h file:


3. Instantiate and set up location manager in the .m file:

4. Inside the button handler:


This tells the location manager to start updating.

5. This function gets called by the location manager. It is like a callback. The location manager will call this function every time the location is updated.

All this does in this case is dump the data to the debug window.