1. You need to call the following function "IOS 8 dedicated" before using corelocation:
IOS 8 has made some modifications to the location, including the method of locating authorization, and Cllocationmanager adds the following two methods:
(1) Always allow access to location information
-(void) requestalwaysauthorization;
(2) Allow access to location data during use of the application
-(void) requestwheninuseauthorization;
Examples are as follows:
Self.locationmanager = [[Cllocationmanager alloc]init];
_locationmanager.delegate = self;
_locationmanager.desiredaccuracy = Kcllocationaccuracybest;
_locationmanager.distancefilter = 10;
[_locationmanager requestalwaysauthorization];//Add this sentence
[_locationmanager startupdatinglocation];
2. Add the following configuration in the Info.plist file:
(1) nslocationalwaysusagedescription
(2) Nslocationwheninuseusagedescription
The values of these two keys are the description of the authorization alert, and the example configuration is as follows [tick show Raw keys/values to add]:
Steps to start the location service after the core IOS8 framework