我正在尝试使用 UISearchBar 和 UITableView 从我的用户类返回用户。出于某种原因,我无法从 Parse 中的 User 类中检索任何对象。您是否知道为什么我无法获取任何对象,即使 User 类中有很多用户?
这是我的做法:
- (void)refresh {
PFQuery *query = [PFQuery queryWithClassName:@"User"];
[query orderByAscending:@"createdAt"];
query.limit = 1000;
[query findObjectsInBackgroundWithBlock:^(NSArray *posts, NSError *error) {
if (!error) {
[_refreshControl endRefreshing];
[_people setArray:posts];
[_tableView reloadData];
NSLog(@"%@", posts);
} else {
NSLog(@"Error fetching users");
}
}];
}
最佳答案
尝试将方法中的第一行替换为:
PFQuery *query = [PFUser 查询]
关于ios - 无法从 Parse.com iOS 中的用户类返回对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29858204/