自从第一个Xcode 6 beta 1开始,我一直在开发一个依赖于CoreLocation的应用程序。上周我在iTunes connect/TestFlight上提交了它以进行测试。该应用程序完全适用于开发设备,但是当我创建adhoc版本时,它不会要求授权。
细节:
Settings > General > Reset > Reset Location Warnings
没有解决Linked Frameworks and Libraries
上(但删除后没有任何更改)答案 0 :(得分:1)
更改此代码:
func askForLocation(sender: AnyObject) {
if (locationStatus == CLAuthorizationStatus.Denied) {
let url = NSURL.URLWithString(UIApplicationOpenSettingsURLString)
UIApplication.sharedApplication().openURL(url)
} else if (locationStatus != CLAuthorizationStatus.AuthorizedWhenInUse) {
locationManager.requestWhenInUseAuthorization()
} else if (locationStatus == CLAuthorizationStatus.AuthorizedWhenInUse){
self.performSegueWithIdentifier("seguePlaceViewController", sender: sender)
}
}
到
func askForLocation(sender: AnyObject) {
locationManager.requestWhenInUseAuthorization()
if (locationStatus == CLAuthorizationStatus.Denied) {
let url = NSURL.URLWithString(UIApplicationOpenSettingsURLString)
UIApplication.sharedApplication().openURL(url)
} else if (locationStatus == CLAuthorizationStatus.AuthorizedWhenInUse){
self.performSegueWithIdentifier("seguePlaceViewController", sender: sender)
}
}
此更新解决了您的问题。