Wednesday, May 27, 2015

iPhone: CLLocation: Get current location


http://kennyray.com/2013/06/27/iphone-cllocation-get-current-location/


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.

No comments: