启用Parse的enableLocalDatastore时,远程数据错误 [英] Wrong remote data when enableLocalDatastore with Parse
问题描述
我在我的swift应用程序上启用了解析本地数据存储.我想将远程数据与本地同步,但是指针数组遇到问题.
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.
我有一个这样的PFSubclass:
I have a PFSubclass like this :
class ShotModel : PFObject, PFSubclassing {
@NSManaged var status: String?
@NSManaged var pics: [PicModel]?
}
当我在Parse服务器上更新status
时,数据与我的本地数据存储同步,但是当更新pics
指针数组时,本地数据不会更改.
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.
例如:
- 我获取镜头列表(镜头阵列),其中仅包含一张镜头及其3张照片.
- 我从服务器上得到了很好的响应(一个镜头,一张照片和3张照片)
- 我用4张照片在Parse服务器上更新了这张照片
- 我重新获取应该包含一张照片及其4张照片的照片清单.
- 响应现在是错误的:镜头只有3张照片
查询结果为:
[<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?
推荐答案
V1.7.5-2015年6月24日修复了该错误 https://parse.com/docs/downloads
V1.7.5 — JUNE 24, 2015 fixes this bug https://parse.com/docs/downloads
这篇关于启用Parse的enableLocalDatastore时,远程数据错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!