【发布时间】:2017-06-18 09:32:20
【问题描述】:
我正在尝试构建一个显示用户高度的应用程序,但 xCode 说 CLLocation 没有成员“高度”。我使用的代码是
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { self.Altitude.text = String(locations.altitude)}
【问题讨论】:
-
Locations 是一个位置数组,而数组没有属性
altitude。您必须首先从数组中获取其中一个位置元素,例如locations[0].altitude
标签: swift swift3 core-location