Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.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
Iphone UITableView值在移动时不断更改_Iphone - Fatal编程技术网

Iphone UITableView值在移动时不断更改

Iphone UITableView值在移动时不断更改,iphone,Iphone,我已经配置了一个表视图单元格,它的表单元格是从另一个xib加载的,文件名和标识都被称为BlogViewControllerTableCell 它们中的大多数工作正常,但单元格中的某些内容在滚动时不断变化。 无论我使用数组值,还是简单地将[indexpath行] 下面是代码, 我将非常感谢你的帮助。 谢谢 您没有更改这些行中的任何单元格值。学生名称不是来自单元格??1。我们需要知道学生的名字。它是一个IB插座吗?您将单元的xib装入其中??2.stringWithFormat:@“%@”完全没有用

我已经配置了一个表视图单元格,它的表单元格是从另一个xib加载的,文件名和标识都被称为BlogViewControllerTableCell 它们中的大多数工作正常,但单元格中的某些内容在滚动时不断变化。 无论我使用数组值,还是简单地将[indexpath行]

下面是代码, 我将非常感谢你的帮助。 谢谢


您没有更改这些行中的任何单元格值。学生名称不是来自单元格??1。我们需要知道学生的名字。它是一个IB插座吗?您将单元的xib装入其中??2.stringWithFormat:@“%@”完全没有用。如果单元格内容正在更改,那肯定是因为您将单元格缓慢地返回,并且在您的更新过程完成之前它们就被重用了。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BlogViewControllerTableCell"];
    if (cell == nil) {
        // Load the top-level objects from the custom cell XIB.
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"BlogViewControllerTableCell" owner:self options:nil];
        // Grab a pointer to the first object (presumably the custom cell, as that's all the XIB should contain).
        cell = [topLevelObjects objectAtIndex:0];
    }
    student_name.text = [NSString stringWithFormat:@"%@", [[student_list objectAtIndex:[indexPath row]] objectForKey:@"name"]];
    return cell;
}