There are two new methods for locating features in IOS8:
-(void) requestwheninuseauthorization __osx_available_starting (__mac_na, __iphone_8_0);-(void) Requestalwaysauthorization __osx_available_starting (__mac_na, __iphone_8_0);
These two new methods cause the previously written program to appear in IOS8, the location function is not working properly
So let iOS8 normal use positioning function?
<1> you need to add two variables to the Info.plist table
Add two default fields to the Info.plist
These two fields are not particularly interesting in that they are customized to prompt the user for permission to use the geolocation feature.
This writes the code:
Cllocationmanager *locationmanager = [[Cllocationmanager alloc]init]; Locationmanager.delegate = self; [Locationmanager requestalwaysauthorization]; Locationmanager.desiredaccuracy = kcllocationaccuracybest; Locationmanager.distancefilter = Kcldistancefilternone; [Locationmanager startupdatinglocation];
This is a call to the proxy
-(void) Locationmanager: (Cllocationmanager *) Manager didchangeauthorizationstatus: (clauthorizationstatus) Status { switch (status) {case kclauthorizationstatusnotdetermined: if ([Locationmanager respondstoselector:@ Selector (requestalwaysauthorization)]) { [Locationmanager requestwheninuseauthorization]; } break; Default: Break ; }}
This will be OK, the original cue box pops up
iOS Baidu Map does not locate the problem