使用Parse查询指针属性

ado*_*srs 5 ios parse-platform swift

我在Parse上用User和Request作为类开发应用程序.我的用户将currentLocation(PFGeoPoint)作为属性,并且Requests有一个指针来引用拥有该请求的用户(请求者:PFUser).所以我试图找到当前用户登录附近的用户的请求.

我需要做类似的事情:

let currentUserGeoPoint = PFUser.currentUser()!["currentLocation"] as! PFGeoPoint

var query = PFQuery(className:"Request")
query.whereKey("requestor.currentLocation", nearGeoPoint: currentUserGeoPoint)
query.findObjectsInBackgroundWithBlock {
      (objects, error) -> Void in
          if (error == nil) {
             self.userRequests = objects!
             self.tableView.reloadData()
          }else {
             println(error?.userInfo)
          }
}
Run Code Online (Sandbox Code Playgroud)

但不幸的是,这是不可能的:

[Error]: Dot notation can only be used on objects (Code: 102, Version: 1.8.1)
Optional([code: 102, error: Dot notation can only be used on objects, temporary: 0, NSLocalizedDescription: Dot notation can only be used on objects])
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

这就是我的Request Class在Parse上的样子:

在此输入图像描述

这是用户类:

在此输入图像描述

the*_*tic 8

根据Parse社区中的这个问题:

您可以使用whereKey:matchesKey:inQuery:或whereKey:matchesQuery:而不是whereKey:中的点表示法.