Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c PFQuery findObjectsInBackground返回nil。为什么?_Objective C_Parse Platform_Pfquery - Fatal编程技术网

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数组
是否为
非零
结束此数组中的对象
非空。