Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Parse platform PFQueryTableViewController“无结果”单元格_Parse Platform_Pfquery - Fatal编程技术网

Parse platform PFQueryTableViewController“无结果”单元格

Parse platform PFQueryTableViewController“无结果”单元格,parse-platform,pfquery,Parse Platform,Pfquery,我正在使用PFQueryTableViewController显示来自PFObjects的数据,但我想为没有对象显示时创建一个替代单元格。我尝试过这样做,但当我在numberOfRowsInSection中返回1时,出现以下错误: *由于未捕获异常“NSRangeException”而终止应用程序,原因:“*-[\uu NSArrayM objectAtIndex:]:索引0超出空数组的界限” 我不知道该怎么办,但我有以下代码: - (NSInteger)tableView:(UITableVi

我正在使用PFQueryTableViewController显示来自PFObjects的数据,但我想为没有对象显示时创建一个替代单元格。我尝试过这样做,但当我在numberOfRowsInSection中返回1时,出现以下错误: *由于未捕获异常“NSRangeException”而终止应用程序,原因:“*-[\uu NSArrayM objectAtIndex:]:索引0超出空数组的界限”

我不知道该怎么办,但我有以下代码:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if ([self.objects count] != 0){
        // Return the number of rows in the section.
        return [self.objects count];
    }else{
        return 1;
    }
}

我用这个问题的答案找到了答案:

添加cellForIndexPath函数。我想这是你的问题。我已经有了cellForRowAtIndexPath。还有其他建议吗?看起来怎么样。我怀疑这是错的,好吧。当我在cellForRowAtIndexPath上使用断点运行它时,断点在崩溃之前甚至都不会被触发。你能过来看看吗。