我有對象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