Wrong remote data when enableLocalDatastore with Parse

风格不统一 提交于 2020-01-15 06:54:27

问题


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:


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



来源:https://stackoverflow.com/questions/30729455/wrong-remote-data-when-enablelocaldatastore-with-parse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!