对Parse.com上的数组值的查询不起作用

时间:2014-08-31 01:44:17

标签: ios objective-c arrays parse-platform pfquery

这基本上是在杀死我的应用程序,而Parse并没有完全提示他们的回复。 指针数组的查询工作。

在您的应用中尝试此操作:

- (void)runTest{
   // Run a build to store 20 rows.
   for(int i=0;i<20;i++){
       NSMutableArray *recipients = [NSMutableArray array];
       [recipients addObject:[PFUser currentUser]];
       PFObject *message = [PFObject objectWithClassName:@"Run"];
       [message addObjectsFromArray:recipients forKey:@"recipients"];
       [message saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {

       }];
   }
}

- (void)runTestQuery{
   // Run a second build to query the 20 rows. Not all 20 are returned.

   PFQuery *query = [PFQuery queryWithClassName:@"Run"];
   [query whereKey:@"recipients" equalTo:[PFUser currentUser]];
   [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
       NSLog(@"Objects count: %li",(long)objects.count);
   }];

}

0 个答案:

没有答案