尝试做以下事情
1.)注册你的tableView
[_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"SimpleTableItem"];
2.)然后[_tableView reloadData];
在下面添加
for (PFObject *object in objects) { NSLog(@"%@", object.objectId); tableData[countUsers] = [object valueForKey:@"username"]; matchesForUser[countUsers] = [object valueForKey:@"matches"]; }
内部if (!error)
..
所以你的更新代码必须如此
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (!error) { for (PFObject *object in objects) { NSLog(@"%@", object.objectId); tableData[countUsers] = [object valueForKey:@"username"]; matchesForUser[countUsers] = [object valueForKey:@"matches"]; } [_tableView reloadData]; }else{ NSLog([error description]); } NSLog(@"***tabledata***"); NSLog([NSString stringWithFormat:@"%lu", (unsigned long)[tableData count]]); NSLog(@"***matchesdata***"); NSLog([NSString stringWithFormat:@"%lu", (unsigned long)[matchesForUser count]]); }];