ios - Parse.com 无法访问指向 PFObject 的指针

标签 ios objective-c uitableview pointers parse-platform

我在 Parse.com 上有对象 GroupRequest 和 Group。每个 GroupRequest 都有一个指向名为“group”的 Group 对象的指针。我已查询获取 GroupRequests 数组,现在我试图在 TableView 中的该数组中的 GroupRequests 中显示每个组的“名称”字符串属性。

但是,当我尝试访问 [@"name"] 时遇到了麻烦。程序崩溃并说:

“'NSInternalInconsistencyException',原因:'键“name”没有数据。在获取其值之前调用 fetchIfNeeded。'”

如何正确访问组名?下面是我用来尝试访问 [@"name"] 属性的代码:

- (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 对象的数组。

最佳答案

你需要通过写来获取指针字段

[query includeKey:@"group"];

关于ios - Parse.com 无法访问指向 PFObject 的指针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28408082/

相关文章:

objective-c - UIViewController 中的 PullToRefresh TableView

iOS 以编程方式删除浏览历史记录

ios - 谁应该管理 UI 元素、 View 或 View Controller ?

javascript - iPhone AVPlayer 从 PhoneGap 中的远程 URL 进行流式传输

ios - 如何在 iOS 中从一个下拉菜单导航到下一个下拉菜单?

ios - 在 Swift 的 UITableView 部分获取行的 [NSIndexPath] 数组

objective-c - UItableViewCell 与 UIDatePicker : month column gets covered

ios - 将 Parse PFGeoPoints 数组显示为 map 注释错误

ios - 解析.com : how to join 2 tables?

ios - Xcode 项目格式 : what are the differences between 3. 1、3.2、6.3 和 8.0?