today in the development of the discovery of a iOS8 location problem, after the operation, do not call to the delegate method after the location, and then found some information to understand the iOS8 system under the positioning, the discovery is really different:
Workaround:
1. Add key in Info.plist;
Nslocationwheninusedescription, allowing GPS descriptions to be obtained at the front desk
Nslocationalwaysusagedescription, allows the description of GPs to be acquired in the background
2. In code positioning, make the version distinction and authorization request:
if ([Cllocationmanager locationservicesenabled]) { if (!self.locationmanager) { Self.locationmanager = [[Cllocationmanager alloc] init]; } Self.locationManager.delegate = self; self.locationmanager.distancefilter=1.0; Self.locationManager.desiredAccuracy = kcllocationaccuracybest; if ([Self.locationmanager respondstoselector: @selector (requestalwaysauthorization)]) { [ Self.locationmanager Requestalwaysauthorization]; Perpetual authorization [Self.locationmanager requestwheninuseauthorization];//Authorization in Use } [Self.locationmanager startupdatinglocation];//open Position Update self.delegate = delegate; }
OK, fix it. The change also shows that Apple has begun to design a hierarchy of privacy authorizations that are no longer limited to the 2 option of 1. This is a good thing!
iOS8 System Positioning problem