简体   繁体   English

如何在iphone中刷新UITableView?

[英]How to refresh a UITableView in iphone?

I have a UI table view loading data from.network.我有一个 UI 表视图从 .network 加载数据。 If the user move the finger on one cell, one button will be displayed, just like iPhone style delete button.如果用户在一个单元格上移动手指,将显示一个按钮,就像 iPhone 风格的删除按钮。 If the user click this button, the value of one label in the cell will be changed accordingly.如果用户点击这个按钮,单元格中一个label的值将相应改变。 However, I didn't find any way to make table view to re-draw this cell, except for reload the whole table.但是,除了重新加载整个表格之外,我没有找到任何方法让表格视图重新绘制此单元格。 I don't want to use reload data method, because I just need change the value in one cell instead of the whole table.我不想使用重新加载数据方法,因为我只需要更改一个单元格而不是整个表格中的值。 Any suggestion on this?对此有何建议?

Take a look at the method看看方法

- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation

Calling this method will result in your table view's data source asking its delegate for information about that cell.调用此方法将导致您的表视图的数据源向其委托询问有关该单元格的信息。

For future reference, I found this very easily by checking the documentation on UITableView. I suggest you do that in the future before posting here.为了将来参考,我通过查看 UITableView 上的文档很容易地找到了这一点。我建议您以后在此处发布之前这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM