if ([Cllocationmanager locationservicesenabled] && [Cllocationmanager authorizationstatus] = = kclauthorizationstatusdenied) {//Determine if the software is enabled for positioning
Jjlog (@ "not open");
self.isaddress = YES;
Uialertview *alertview = [[Uialertview alloc]initwithtitle:@ "open position switch" message:@ "Click Settings to open Location Services" Delegate:self cancelbuttontitle:@ "Cancel" otherbuttontitles:@ "Settings", nil];
[Alertview show];
}else{
Jjlog (@ "open");
}
-(void) Alertview: (Uialertview *) Alertview Clickedbuttonatindex: (Nsinteger) buttonindex{
if (Buttonindex = = 1) {
Nsurl *url = [Nsurl urlwithstring:uiapplicationopensettingsurlstring];
if ([[[UIApplication sharedapplication] Canopenurl:url]) {
[[UIApplication sharedapplication] openurl:url];
}
}
}
iOS simple implementation if the location is not enabled, prompt to turn on the system software positioning function