查询Parse for Users notContainedIn constraints

时间:2016-01-07 18:38:21

标签: ios objective-c parse-platform

我正在运行和应用程序,当你喜欢或不喜欢另一个用户时,结果存储在“已接受”(喜欢)或“被拒绝”数组的数组中。该数组包含您喜欢/不喜欢的用户objectId。

当我查询结果时,我使用的是whereKey:notContainedIn方法:

PFQuery *query = [PFUser query];  
[query whereKey:@"objectId" notContainedIn:[PFUser currentUser][@"accepted"]];

[query whereKey:@"objectId" notContainedIn:[PFUser currentUser][@"rejected"]];

[query findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {

        if (!error) {
            for (PFObject *object in objects) {

                self.displayedUserId = object.objectId;
                NSLog(@"userId: %@", self.displayedUserId);

                PFFile *imageFile = object[@"image"];
                [imageFile getDataInBackgroundWithBlock:^(NSData * _Nullable data, NSError * _Nullable error) {
                    if (!error) {
                        UIImage *image = [UIImage imageWithData:data];
                        self.userImage.image = image;
                    }else {
                        NSLog(@"%@", error);
                    }
                }];
            }
        }else {
            NSLog(@"%@", error);
        }
    }];

错误:

  

[__ NSPlaceholderArray initWithObjects:count:]:尝试从对象插入nil对象[0]

我不确定如何调试或后续步骤。

0 个答案:

没有答案