大家好,我正在学习一个地图教程,但它在教程中使用的是Xcode7。
在本教程中,他使用了此链接,但在新版本中已停止。有人能告诉我复制这个的最好方法吗?
我已经在plist中添加了NSLocationWhenInUseUsageDescription。
func locationAuthStatus() {
if CLLocationManager.authorizationStatus() == .authorizedWhenInUse {
map.showsUserLocation = true
}else {
//cant get this to work in ios10
locationManager.requestWhenInUseAuthorization()
}
}任何帮助都将不胜感激。
发布于 2016-09-20 09:41:13
解决了..。
我意识到我创建了一个名为locationManager的常量,但将其拼写为lacationManager,我不明白为什么它要求我将其更改为LacationManager,然后我意识到拼写错误。
现在一切正常。
https://stackoverflow.com/questions/39583497
复制相似问题