12

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

[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。

4

1 回答 1

1

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

From the 1.6.3 release notes:

"Improved consistency of Local Datastore / Parse queries with includeKey: and NSNull values."

于 2015-07-26T23:25:20.713 回答