Objective c PFQuery findObjectsInBackground返回nil。为什么?
如果我使用Objective c PFQuery findObjectsInBackground返回nil。为什么?,objective-c,parse-platform,pfquery,Objective C,Parse Platform,Pfquery,如果我使用[query includeKey@“someKey”]方法 [query findObjectsInBackground]返回nil,当我不使用includeKey时,findObjectsInBackground返回按键数组@“someKey”的对象,但此数组返回空对象 代码示例 PFQuery *query = [PFQuery queryWithClassName:@"PrimaryCategory"]; //[query includeKey:@"primar
[query includeKey@“someKey”]
方法
[query findObjectsInBackground]
返回nil
,当我不使用includeKey时,findObjectsInBackground返回按键数组@“someKey”的对象,但此数组返回空对象
代码示例
PFQuery *query = [PFQuery queryWithClassName:@"PrimaryCategory"];
//[query includeKey:@"primaryIncomesCategories"];
[query fromLocalDatastore];
[query findObjectsInBackgroundWithBlock:^(NSArray *PF_NULLABLE_S objects, NSError *PF_NULLABLE_S error)
{
if (!error && objects.count)
{
self.primaryIncomesCategories = [self convertPFObjectToFBAPFCategory:objects.firstObject[@"primaryIncomesCategories"]];
}
if(completion)
completion();
}];
}
primaryIncomesCategories = (
"<p><Category: 0x796f8dd0, objectId: eLiQQ0OCxV, localId: (null)> {\n}",
etc
在日志中
PFQuery *query = [PFQuery queryWithClassName:@"PrimaryCategory"];
//[query includeKey:@"primaryIncomesCategories"];
[query fromLocalDatastore];
[query findObjectsInBackgroundWithBlock:^(NSArray *PF_NULLABLE_S objects, NSError *PF_NULLABLE_S error)
{
if (!error && objects.count)
{
self.primaryIncomesCategories = [self convertPFObjectToFBAPFCategory:objects.firstObject[@"primaryIncomesCategories"]];
}
if(completion)
completion();
}];
}
primaryIncomesCategories = (
"<p><Category: 0x796f8dd0, objectId: eLiQQ0OCxV, localId: (null)> {\n}",
etc
我用这种方法储蓄
[primaryCategory setObject:incomeCategoryArray forKey:@"primaryIncomesCategories"];
[primaryCategory pinInBackground];
incomeCategory数组
是否为非零
结束此数组中的对象非空。