ios - 为什么 PFRelation 不支持 fromLocalDataStore 查询?

标签 ios parse-platform pfrelation

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

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

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

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

它不返回任何内容,尽管我已经使用 [myObject pinInBackground] 固定了我的用户和相关对象。

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

最佳答案

我创建了一个 bug report对于这个问题是

escalated to the engineering team to investigate further

所以看起来是个bug

与此同时,我已将我所有的 PFRelations 转换为指向相关 PFObject 的指针数组。不像 PFRelation 那样花哨,但可以很好地处理本地数据存储。

更新:解析solved the issue在 Parse SDK v.1.7.3 中

关于ios - 为什么 PFRelation 不支持 fromLocalDataStore 查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28930462/

相关文章:

swift - 如何获取query.whereKey(key, containedIn : [Array]) to work with relation.查询

插入或拔下耳机时 iOS 应用程序崩溃

objective-c - 我应该在哪里创建我的线程? ( Objective-C )

ios - Swift - Parse.com - 为什么这个闭包是错误的?

ios - Parse.com 对 iOS 应用程序进行压力测试

ios - 在 iOS 中使用 Parse 调用 findObjectsInBackGroundWithBlock() 时出现问题

php - iOS 尝试将位置更新发布到服务器

ios - "On my iPhone"选项在模拟器中不可见。

ios - 计算 PFRelation 中的对象数