我正在使用Parse.com iOS SDK,我需要用户的当前位置,所以我使用的功能是
PFGeoPoint.geoPointForCurrentLocationInBackground(…).
PFGeoPoint.geoPointForCurrentLocationInBackground() { (point:PFGeoPoint!,error:NSError!) -> Void in NSLog("Test log 1") // Never printed if point != nil { // Succeeding in getting current location NSLog("Got current location successfully") // never printed PFUser.currentUser().setValue(point,forKey: "location") PFUser.currentUser().saveInBackground() } else { // Failed to get location NSLog("Failed to get current location") // never printed } }
任何的想法?
我有同样的问题.它已在Parse 1.4.0中修复.
您还需要将以下键/值对添加到应用的info.plist中:
<key>NSLocationWhenInUseUsageDescription</key> <string>We want to send your location data to the NSA,please allow access to location services. (replace this text with whatever you want the dialog to say)</string>
参考文献:
> Parse SDK for iOS 8
> CLLocationManager in iOS 8 – use of NSLocationWhenInUseUsageDescription
原文地址:https://www.jb51.cc/swift/318704.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。