首页 > 解决方案 > 解析 findObjectsInBackground 返回空数组

问题描述

我正在使用 Parse v1.17.2。

我有一个 PFQuery 应该在后台从远程返回对象。

//* ObjC *
PFQuery *custQuery = [CustomSentences query];
[custQuery fromLocalDatastore];
[custQuery whereKey:[CustomSentences userRef] equalTo:[PFUser currentUser]];
[custQuery whereKey:[CustomSentences visibility] equalTo:[NSNumber numberWithBool:YES]];
[custQuery orderByDescending:[CustomSentences updatedAt]];
[custQuery findObjectsInBackgroundWithBlock:^(NSArray *localObjects, NSError *error){
    localObjects = [ParseUtils removeInvalidObjects:localObjects];
    cust(localObjects,error);
    PFQuery *custRQuery = [CustomSentences query];
    [custRQuery whereKey:[CustomSentences userRef] equalTo:[PFUser currentUser]];
    [custRQuery findObjectsInBackgroundWithBlock:^(NSArray *remoteObjects, NSError *error){
        remoteObjects = [ParseUtils removeInvalidObjects:remoteObjects];
        NSLog(@"Local Object Count : %lu ; Remote Object Count : %lu",(unsigned long)[localObjects count],[remoteObjects count]);
    }];
}];

远程对象数组始终为空。请帮忙。我该如何调试它..

标签: parse-platformpfquerypfobject

解决方案


推荐阅读