gpt4 book ai didi

ios - (iPhone)如何在TableView中仅更新一行

转载 作者:行者123 更新时间:2023-12-01 17:34:52 24 4
gpt4 key购买 nike

我有一个tableview,我将对tableview中的数据进行更新。它每秒钟接收一次数据,当接收到数据时,它将替换一行中的旧数据。
我喜欢这样:
当收到数据时,我打电话

[m_tableView reloadData];

因此,它将调用
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath  *)indexPath{ }

所以我将以这种方法更改特定的行数据,但是如何设置 row index呢?

最佳答案

你有没有尝试过

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

迅速
func reloadRows(at indexPaths: [IndexPath], with animation: UITableView.RowAnimation)

这将允许您重新加载单行。
reloadData方法重新加载整个表

关于ios - (iPhone)如何在TableView中仅更新一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7257603/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com