指针数据未存储在本地数据库解析

指针数据未存储在本地数据库解析

本文介绍了指针数据未存储在本地数据库解析 ios 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含许多包含键的查询,它们是指向另一个类的指针.从解析云接收数据后,所有记录都使用 pinAll 方法存储在本地.当我取回存储的结果时,我可以获取记录但不包含指针.请参阅下面的示例代码

I have a query with many includeKeys which are pointers to another class. After receiving the data from parse cloud all the records are getting stored locally using pinAll method. When I fetch back the results stored, I can able to get the records but not pointers included. See sample code below

[query includeKey:@"classOne.innerClass"];
[query includeKey:@"classTwo.innerClass"];
[query includeKey:@"classThree"];
[query includeKey:@"classFour"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){
   [PFObject pinAllInBackground:objects withName:@"LocalRecords" block:^(BOOL succeeded, NSError *error) {

   }];
}];

我正在获取像

PFQuery *lquery = [PFQuery queryWithClassName:[ClassName parseClassName]];
   [lquery fromPinWithName:@"LocalRecords"];
   BFTask *btask = [[lquery findObjectsInBackground] continueWithSuccessBlock:^id(BFTask *task) {
        if (task.error) {
            NSLog(@"Error: %@", task.error);
            return task;
        }
   }];

当我尝试访问 classOne、classTwo、classThree 和 classFour 中的任何列时,出现异常 由于未捕获的异常NSInternalInconsistencyException"而终止应用程序,原因:键名称"没有数据.在获取其值之前调用 fetchIfNeeded.'

When I try to access any of the columns in classOne, classTwo, classThree and classFour I am getting an exception Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Key "name" has no data. Call fetchIfNeeded before getting its value.'

推荐答案

这是适用于 iOS 的 Parse.com 本地数据存储功能中的一个错误.

This was a bug in the Parse.com local data store functionality for iOS.

来自 1.6.3 发行说明:

From the 1.6.3 release notes:

使用 includeKey: 和 NSNull 值改进了本地数据存储/解析查询的一致性."

这篇关于指针数据未存储在本地数据库解析 ios 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 15:55