Wrong remote data when enableLocalDatastore with P

2019-07-21 11:21发布

I have enable Parse local-datastore on my swift application. I want to sync remote data with local but I am facing issues with Pointer Array.

I have a PFSubclass like this :

class ShotModel : PFObject, PFSubclassing {
  @NSManaged var status: String?
  @NSManaged var pics: [PicModel]?
}

And when I update status on Parse server, the data is sync with my local datastore but when update the pics Pointer Array, the local data are not changed.

For example:

  1. I fetch shots list (Array of Shot) which contain only one shot and its 3 pics.
  2. I get the good response from the server (an Array with one shot and its 3 pics)
  3. I update this shot on Parse server with 4 pics
  4. I re-fetch shots list which is supposed to contain one shot and its 4 pics.
  5. The response is now wrong: the shot has only 3 pics

The result of query is :

[<Shot: 0x170382d80, objectId: VwA1Qc9NBN, localId: (null)> {
  pics =     (
      "<Pic: 0x14ee64460, objectId: h5TGCb8BAx, localId: (null)> {\n  \n}",
      "<Pic: 0x14ee645d0, objectId: fZ61mvMUAM, localId: (null)> {\n  \n}",
      "<Pic: 0x14ee634f0, objectId: g8Wbxyk8E3, localId: (null)> {\n  \n}"
  );
  status = Done;
}]

I get the same result wether I delete one, two or all pics.

When i make a remote fetch, the response query always return old Pointer Array list, I don't know why.

Do you know why parse behaves like that, or am i doing something wrong?

1条回答
孤傲高冷的网名
2楼-- · 2019-07-21 12:17

V1.7.5 — JUNE 24, 2015 fixes this bug https://parse.com/docs/downloads

查看更多
登录 后发表回答