我有一个可下载项目的 UITableView,我使用另一个 UITableView 作为下载项目信息。如何重新加载所有 UITableViewCell 的 UiTableView?
我尝试使用[downloadList reloadData];
,但它只会刷新大表。
编辑:我正在尝试做这样的事情:jsfiddle.net/WrNFU。我希望细节正确对齐,但问题是标题可能太长,我不确定标题将使用多少行。我使用了第二个表,因为 heightForRowAtIndexPath 函数使我能够调整标题行的高度。
回答:
使用我在这里找到的代码:iPad:遍历 UITableView 中的每个单元格?
for (int section = 0; section < [downloadList numberOfSections]; section++) {
for (int row = 0; row < [downloadList numberOfRowsInSection:section]; row++) {
NSIndexPath* cellPath = [NSIndexPath indexPathForRow:row inSection:section];
UITableViewCell* cell = [downloadList cellForRowAtIndexPath:cellPath];
UITableView *tempTableView = (UITableView *)[cell viewWithTag:110];
[tempTableView reloadData];
}
}