我有一个PFQueryTableViewController
加载Thread
s (PFObjects 与关于论坛线程的数据)就好了。
当按下一个单元格时,PFQuertyTableViewController
会加载一个新Response
的 s(PFObjects 包含有关用户在线程上的响应的数据),但我无法确保它们是Response
特定于那个的Thread
。
我可以很容易地得到所有的响应,
NSArray *responses = thread[@"responses"];
但是,我不知道如何将它与 a PFQuery
in a一起使用PFQueryTableViewController
。这是我尝试过的:
我从这个论坛帖子中得到了这个想法,但它对我没有任何作用(self.objects 是空的)。
- (PFQuery *)queryForTable
{
PFQuery *query = [PFQuery queryWithClassName:self.parseClassName];
NSArray *threads = self.topic[@"threads"];
for (PFObject *thread in threads)
{
[thread fetchIfNeeded];
NSLog(@"Thread title: %@", thread[@"title"]);
}
[query whereKey:@"title" containedIn:threads];
return query;
}
输出:
Thread title: This is my title for my post about "Animal Rights"
2014-06-20 10:25:11.730 ThumbWar[9185:60b] Fetched: <Thread:dasLkCUo77:(null)> {
title = "This is my title for my post about \"Animal Rights\"";
user = "<PFUser:********>";
}