2

Parse バージョン「1.14.4」iOS 10.3.2 および Swift 3 を使用しています。ローカル (返されたオブジェクトが固定されている) かリモートかにかかわらず、クエリは低速です。ありがとう

let placeObject = PFObject(className:"PlaceObject")
let point = PFGeoPoint(latitude:self.PointGlobal.latitude, longitude:self.PointGlobal.longitude)
placeObject["location"] = point
let query = PFQuery(className:"CLocationObject")
// Interested in locations near user.
query.whereKey("location", nearGeoPoint:point)
// Limit what could be a lot of points.
query.limit = 200
let localQuery = (query.copy() as! PFQuery).fromLocalDatastore()

localQuery.findObjectsInBackground{
  (objects: [PFObject]?, error: Error?) -> Void in

self.dataReturnedLocally = true

.....

if self.dataReturnedLocally{
print("local query with no error there was data already")
}

  else {
  print("getting data remotely")
  query.findObjectsInBackground{
    (objects: [PFObject]?, error: Error?) -> Void in
    if error == nil {

      if let objects = objects  {
4

2 に答える 2