我有对象GroupRequest和Group on Parse.com。每个GroupRequest都有一个指向名为“group”的Group对象的指针。我查询过要获取GroupRequests数组,现在我试图在表视图中显示该数组中的GroupRequests中每个Group的“名称”字符串属性。Parse.com无法访问指向PFObject的指针
但是,当我尝试访问[@“name”]时,我遇到了麻烦。该程序崩溃,说:
“‘NSInternalInconsistencyException’,理由是:‘主要‘名’。没有数据获取其值之前调用fetchIfNeeded’”
我怎样才能正确地访问组的名称?下面是我用来尝试访问[@“名”]属性的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"notificationCell" forIndexPath:indexPath];
self.pendingRequestBeingDisplayed = [self.pendingRequests objectAtIndex:indexPath.row];
self.tempGroup = self.pendingRequestBeingDisplayed[@"group"];
cell.textLabel.text = self.tempGroup[@"name"];
return cell;
}
self.pendingRequests是GroupRequest对象的数组。
等等,如果我查询获取grouprequests,那么我是否必须再次查询以获取“到”用户,然后再次查询以获取“group”PFObject我想要的? – mnot 2015-02-09 20:41:53
不,如果您使用includeKey,那么它只是一个查询。 – 2015-02-09 20:53:03