O'Reilly logo

Xcode 4 Cookbook by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Determining the current GPS location

In this recipe we will learn how to determine the current GPS location of our iOS device.

Getting ready

In this section we will see how we can use the CoreLocation framework to determine our latitude and longitude GPS location and output this information within an alertView dialog.

How to do it...

To begin, follow these simple steps as outlined in the following order:

  1. Open the ViewController.h interface file from the Project Navigator section.
  2. Next, modify the interface file as shown by the highlighted code sections in the following code snippet:
    // ViewController.h // CoreLocation // Created by Steven F Daniel on 23/10/12. // Copyright (c) 2012 GenieSoft Studios. All rights reserved. #import <UIKit/UIKit.h> #import ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required