我在iOS 7上运行良好的应用程序无法与iOS 8 SDK一起使用.
CLLocationManager没有返回位置,我也没有在设置 - > 位置服务下看到我的应用程序.我在这个问题上进行了谷歌搜索,但没有出现任何问题.可能有什么不对?
我只能让我的CLLocationManager进行授权.(在ios8下迅速)我甚至添加了一个显式的requestAlwaysAuthorization调用(在ios7下我不需要使用objC)
func finishLaunch() {
//ask for authorization
let status = CLLocationManager.authorizationStatus()
if(status == CLAuthorizationStatus.NotDetermined) {
self.locationManager.requestAlwaysAuthorization();
}
else {
self.startMonitoring()
}
...
}
Run Code Online (Sandbox Code Playgroud)
回调永远不会得到任何东西,但NotDermined并没有向用户显示UIAlertView.
func locationManager(manager: CLLocationManager!, didChangeAuthorizationStatus status: CLAuthorizationStatus) {
if(status == CLAuthorizationStatus.NotDetermined) {
println("Auth status unkown still!");
}
self.startMonitoring()
}
Run Code Online (Sandbox Code Playgroud)
我做错了吗? - 对我来说感觉像个臭虫,但我想要一些反馈