您的位置:首页 > 移动开发 > IOS开发

iOS7 定位服务未开启的提示

2016-05-19 00:00 369 查看
@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"]];

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  iOS 定位服务