@property (nonatomic,strong) UIAlertView *locationAlert;
//定位服务未开启
if (![CLLocationManager locationServicesEnabled]){
_locationAlert = [[UIAlertView alloc] initWithTitle:nil
message:@"定位服务未开启\n请在系统设置中启动定位服务"
delegate:self
cancelButtonTitle:@"暂不"
otherButtonTitles:@"设置", nil];
[_locationAlert show];
// return;
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
//跳到系统的定位服务
if (buttonIndex == 1)
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]];
}
}