An error occurred while locating iOS8.

Source: Internet
Author: User

An error occurred while locating iOS8.

Time: 2014-10-10

Today, during development, I found an iOS8 locating problem. After the operation is executed, the delegate method after positioning will not be called, then I checked the app positioning permission interface on my mobile phone and found that the permission for accessing the user's geographical location of my app was empty. Then I checked the relevant information, the following solutions are available:

1. In Appdelegate:

CLLocationManager * locationManager;
[UIApplication sharedApplication]. idleTimerDisabled = TRUE; locationmanager = [[CLLocationManager alloc] init]; [locationmanager requestAlwaysAuthorization]; // NSLocationAlwaysUsageDescription [locationmanager allocation]; // NSLocationWhenInUseDescription locationmanager. delegate = self;

2. Add the following to info. plist:
NSLocationWhenInUseDescription, which allows you to obtain the GPS description on the foreground
NSLocationAlwaysUsageDescription, which allows you to obtain the GPS description in the background.

For example:

After adding the above content, you can perform the positioning service. Baidu map and AMAP are also such problems.

Recommended articles: http://blog.csdn.net/yongyinmg/article/details/39521523

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.