我只是可以让我的 CLLocationManager 授权。(在 ios8 下 swift)我什至添加了一个明确的 requestAlwaysAuthorization 调用(我不需要在 ios7 下使用 objC)
func finishLaunch() {
//ask for authorization
let status = CLLocationManager.authorizationStatus()
if(status == CLAuthorizationStatus.NotDetermined) {
self.locationManager.requestAlwaysAuthorization();
}
else {
self.startMonitoring()
}
...
}
回调永远不会得到任何东西,但 NotDermed 并且没有 UIAlertView 显示给用户。
func locationManager(manager: CLLocationManager!, didChangeAuthorizationStatus status: CLAuthorizationStatus) {
if(status == CLAuthorizationStatus.NotDetermined) {
println("Auth status unkown still!");
}
self.startMonitoring()
}
我做错了吗?-- 对我来说感觉像是一个错误,但我想要一些反馈