为什么PFRelation不支持fromLocalDataStore查询? [英] Why PFRelation does not support fromLocalDataStore queries?

查看:113
本文介绍了为什么PFRelation不支持fromLocalDataStore查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 PFUser 对象,其中有几个 PFRelation 指向其他对象。当我运行以下代码时:

I have a PFUser object with several PFRelation pointing to other objects. When I run the following code:

PFRelation *relation = [[PFUser currentUser] relationForKey:@"Relation"];
PFQuery *query = [relation query];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){
    NSLog(@"%@", objects);
}];

一切正常。但是,当我想从本地数据存储中执行相同操作时:

it works fine. However, when I want to do the same from the local data store:

PFRelation *relation = [[PFUser currentUser] relationForKey:@"Relation"];
PFQuery *query = [[relation query] fromLocalDataStore]; // !!!
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){
    NSLog(@"%@", objects);
}];

它没有返回任何内容,尽管事实上我用<$ c固定了我的用户和相关对象$ c> [myObject pinInBackground] 。

it returns nothing, despite the fact I've pinned both my user and related objects with [myObject pinInBackground].

为什么 PFRelation 查询不支持 fromLocalDataStore ?我做错了什么?

Why PFRelation queries does not support fromLocalDataStore? What I'm doing wrong?

推荐答案

我创建了一个错误报告这个问题是

I've created a bug report for this issue which is


升级到工程团队进一步调查

escalated to the engineering team to investigate further

所以它看起来像是一个错误

So it looks like it's a bug

In与此同时,我已将所有<​​code> PFRelations 转换为指向相关 PFObject 的指针数组。不像 PFRelation 那样花哨,但适用于本地数据存储。

In the meanwhile, I've converted all my PFRelations to arrays of pointers to related PFObjects. Not as fancy as PFRelation, but works fine with local data storage.

更新 :在Parse SDK v.1.7.3中解析解决了问题

Update: parse solved the issue in Parse SDK v.1.7.3

这篇关于为什么PFRelation不支持fromLocalDataStore查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆