【发布时间】:2011-05-03 03:18:30
【问题描述】:
有什么方法可以测试用户位置服务是否启用 询问用户?
如果服务是,我想要做的是使用用户位置信息 已经开启,或者如果服务关闭则不使用它。我不想问用户 启用服务。
有什么方法可以做到这一点吗?
谢谢。
【问题讨论】:
标签: location mkmapview cllocationmanager prompt
有什么方法可以测试用户位置服务是否启用 询问用户?
如果服务是,我想要做的是使用用户位置信息 已经开启,或者如果服务关闭则不使用它。我不想问用户 启用服务。
有什么方法可以做到这一点吗?
谢谢。
【问题讨论】:
标签: location mkmapview cllocationmanager prompt
if ([CLLocationManager locationServicesEnabled]) {
// do you stuff
}
【讨论】:
if ([CLLocationManager locationServicesEnabled]) { CLLocationManager *clManager = [[CLLocationManager alloc] init]; [clManager setDesiredAccuracy:kCLLocationAccuracyBest]; [clManager startUpdatingLocation]; } 它仍然问我是否允许使用用户位置。