PFQuery findObjectsInBackground返回nil。为什么?

时间:2015-08-22 19:56:54

标签: objective-c parse-platform pfquery

如果我使用[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

如果取消注释&#34;查询includeKey&#34;比在日志中:

(lldb) po objects
nill

我以这种方式储蓄

    [primaryCategory setObject:incomeCategoryArray forKey:@"primaryIncomesCategories"];
    [primaryCategory pinInBackground];

incomeCategory arraynot nill此数组not empty.

中的结束对象

0 个答案:

没有答案