自从第一个Xcode 6 beta 1开始,我一直在开发依赖CoreLocation的应用程序。上周,我将其提交给iTunes connect/TestFlight进行测试。该应用程序在开发设备上可完美运行,但是当我创建临时版本时,它不会要求授权。
细节:
Settings > General > Reset > Reset Location Warnings
不能解决Linked Frameworks and Libraries
上(但删除后未更改)最佳答案
更改此代码:
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)
}
}
此更新解决了您的问题。
关于ios - CoreLocation不适用于iOS 8上的Adhoc分发,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26209086/