iOS8 positioning problem Solving ideas:
1, plist File New add two variables:
A, nslocationalwaysusagedescription=yes; B, Nslocationwheninuseusagedescription=yes
2, increase the judgment whether the mobile phone for the iOS8 system, plus permissions
Locationmanager = [[Cllocationmanager alloc] init];
Locationmanager.delegate = self;
Locationmanager.distancefilter = Kcldistancefilternone;
Locationmanager.desiredaccuracy = Kcllocationaccuracybest;
if (IOS8) {
[Locationmanager requestalwaysauthorization];//always
[Locationmanager requestwheninuseauthorization];//during use//or
}
[Locationmanager startupdatinglocation];
3, increase the agent method:
-(void) Locationmanager: (Cllocationmanager *) Manager didchangeauthorizationstatus: (clauthorizationstatus) status
{
Switch (status) {
Case kclauthorizationstatusnotdetermined:
if ([Locationmanager respondstoselector: @selector (requestalwaysauthorization)])
{
[Locationmanager requestwheninuseauthorization];
}
Break
Default
Break
}
} iOS8 System Click to set the privacy location function directly crashes the problem of this issue is certainly not the problem of iOS8 system, because other apps are good, why your app is a problem, it must be when you add code when the wrong place. I searched the code several times, and finally found that there is a place different from others, that is, when setting the plist file variable type bool should be a string. It is estimated that the apple is judged by a string comparison, so the bool type collapses directly.
iOS8 location issues, as well as a direct crash on iphone Click Set Privacy targeting feature