iOS7 定位服务未开启的提示

原创
2016/05/19 10:34
阅读数 167

@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"]];

    }

}

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
2
分享
返回顶部
顶部