【发布时间】:2015-10-29 23:02:26
【问题描述】:
在这方面找到了多个帖子,但仍然无法将其拼凑起来。
我正在使用 Parse 检索用户的当前位置。文档使它看起来很容易,但似乎缺少一些东西。 https://parse.com/docs/ios/guide#geopoints-getting-the-user-39-s-current-location
首先,我的代码:
class TableViewController: UITableViewController, CLLocationManagerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
print("Get GPS")
PFGeoPoint.geoPointForCurrentLocationInBackground { (geoPoint, error ) -> Void in
if error == nil {
print("Got geoPoint") //Never reaches this
print(geoPoint)
} else {
print(error ) //No error either
}
}
- 我更新了 info.plist 中的 NSLocationWhenInUseUsageDescription
- 试过模拟器和两个真机。
- 添加了 CLLocationManagerDelegate
我试图避免让这变得比它需要的更复杂。
我还尝试了 CLLocationManager 示例,但它似乎也不起作用。
我正在使用所有内容的最新版本...从昨天开始使用 Parse!
我从未因使用我的位置的授权而受到质疑。使用 CLLocationManager 示例进行了尝试!
非常感谢一些指导/支持。
【问题讨论】:
标签: ios parse-platform geolocation