Development and positioning service app for xcode/iOS 5

Source: Internet
Author: User

In this tutorial (also step by step to learn iOS 5 Programming-the third edition-Part 1 of the Chinese version PDF), we will demonstrate how to add the GPS function to the app and get the current location of the user. At the same time, convert the GPS coordinates to the street address information. It is very interesting and simple to implement this function.

 

The positioning service can improve the user experience of the app. If you are developing a travel app, you can search nearby restaurants or hotels based on your current location. You also found that most Image ApplicationsProgramThe positioning function is provided to save the location information of the image. The core location framework provides the necessary objective-C interface to obtain user location information. With the obtained GPS coordinates, you can use the API to parse the actual street or use the map framework to further display the location information on the map.

In this tutorial, we will create a simple app (findimethyl APP) to demonstrate how to use the core location framework. The following is what we will do:

    • Create a simple interface to display GPS coordinates and addresses;
    • Learn how to use core location APIs to retrieve the current location;
    • Use the built-in APIs to convert the GPS coordinates to the street address;

To obtain the user's current location, we need to use the core location framework provided by the ios sdk. However, by default, the core location framework is not added to any xcode project. We need to manually add.

Like other IOs SDK libraries, core location also uses the delegate mode (delegate patter ). To apply the core location framework, our view controllers should also comply with the cllocationmanagerdelegate protocol. This Protocol defines how to obtain location and heading information from the cllocationmanager object.

 

The following is the running interface of the findimethyl app:

 

 

The current address is displayed, which is very specific. If you come to me with kids shoes, buy chocolate.

 

The specific operation steps and technical details are described in 《Step by step to learn IOS programming (Third edition).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.