0
我想找到当前登录的用户附近的用户,但不知何故结果对象不返回任何用户。查询NearGeoPoint返回空对象
var currentUserGeoPoint = PFUser.currentUser()![“currentLocation”] as! PFGeoPoint
var query = PFQuery(className:"User")
query.whereKey("currentLocation", nearGeoPoint: currentUserGeoPoint, withinKilometers: 100)
query.findObjectsInBackgroundWithBlock {
(objects, error) -> Void in
if (error == nil) {
println(objects)
}else {
println(error?.userInfo)
}
}
控制台回报:Optional([])
正如你可以看到我的User类设置为公共的。 (我知道这不是最佳做法)
你可以发布你的解析图片 – Lamar