1

我将 PFQueryTableViewController 子类化,但它只会返回当前登录用户的数据。我怎样才能让它从所有用户那里检索数据?

查询代码

- (PFQuery *)queryForTable {
PFQuery *query = [PFQuery queryWithClassName:self.parseClassName];

// If no objects are loaded in memory, we look to the cache first to fill the table
// and then subsequently do a query against the network.
//if (self.objects.count == 0) {
//    query.cachePolicy = kPFCachePolicyCacheThenNetwork;
//}

//[query orderByDescending:@"QuestionA"];
//[query whereKey:@"post" equalTo:@"0"];


//NSLog(@"%@",query);
return query;
}
4

1 回答 1

0

Parse 文档中,您可以基于每个用户或组更改 PFObject 的权限 - PFQueryTableViewController 将遵守该权限。因此,如果您的表仅显示当前用户的对象,则这些对象很可能受到保护,例如:

object.ACL = [PFACL ACLWithUser:[PFUser currentUser]];

在被保存解析之前。要允许所有用户读取对象,您可以像这样设置权限:

PFACL *acl = [PFACL ACLWithUser:[PFUser currentUser]];
[acl setPublicReadAccess:YES];
object.ACL = acl;
于 2014-02-26T13:29:48.283 回答