Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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 更新UISlider的UITableView TitleForFooterInstruction';价值观改变了吗?_Iphone_Uitableview_Uislider - Fatal编程技术网

Iphone 更新UISlider的UITableView TitleForFooterInstruction';价值观改变了吗?

Iphone 更新UISlider的UITableView TitleForFooterInstruction';价值观改变了吗?,iphone,uitableview,uislider,Iphone,Uitableview,Uislider,我有一个UITableViewCell,里面有一个UISlider。我有一个tableview的页脚文本,我想用UISlider的值更新它 但是,调用[self.tableView reloadData];对于UISlider不起作用,因为调用太多。我能够正确地更新单元格(它也显示值),但无法更新页脚文本。我试过: [self tableView:self.tableView titleForFooterInSection:0]; 但它不起作用。将滑块连接到控制器中的动作方法: [theSli

我有一个UITableViewCell,里面有一个UISlider。我有一个tableview的页脚文本,我想用UISlider的值更新它

但是,调用[self.tableView reloadData];对于UISlider不起作用,因为调用太多。我能够正确地更新单元格(它也显示值),但无法更新页脚文本。我试过:

[self tableView:self.tableView titleForFooterInSection:0];

但它不起作用。

将滑块连接到控制器中的动作方法:

[theSlider addTarget:self 
              action:@selector(adjustSliderValue:) 
    forControlEvents:UIControlEventValueChanged];
执行滑块动作方法:

- (void) adjustSliderValue: (UISlider *) slider
{
    // Change controller's state here. 
    // The next line will trigger -tableView:titleForFooterInSection:
    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex: mySectionIndex] 
                  withRowAnimation:UITableViewRowAnimationNone];
}

这比重新加载整个表更有效。不幸的是,无法直接设置节尾文本。

这不起作用。这与本文中描述的问题相同:--我可以更新单元格的文本标签,但是更新节或表视图以更新页脚不起作用。啊,我现在看到了。好的,看起来您必须实现-tableView:viewForFooterInstitution:。这样,视图完全在您的控制之下,您可以直接与之交互,而无需重新加载数据。为了避免滚动时出现内存相关问题,请将其保留在控制器中。视图可以是任何UIView子类,包括UILabel。啊,你说得对。嘿,如果你能把它写下来作为一个答案,我会把它标记为正确答案,这样你就可以得到分数或其他:)我可以简单地使用[self tableView:self.tableView titleforfooterInstitution:kssection]更新页脚标题。我在seg控制器的水龙头上打电话。作品