0

特定のセルにアクセスするのに苦労しているようです。テーブルビューで選択したオブジェクトの 1 つを変更するだけです。reloadData をもう一度呼び出すよりも効率的な方法が必要です。それが、テーブルセルを選択したときに再構築することによって、テーブルセルの外観を変える唯一の方法だからです。すべての助けをありがとう:)

[self updatePreferences];
[tableView reloadData];

これは、表のセルとの相互作用を処理するメソッドにある atm のすべてです。

4

2 に答える 2

0

セルをカスタム セルにして、更新や更新などのメソッドを追加することもできます。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
  CustomCell *cell = [tableView cellForRowAtIndexPath:indexPath];
  [cell refresh];
}
于 2013-03-14T20:06:59.633 に答える
0

次のコードを使用します。単一のセルをリロードするには。

NSArray *array = [NSArray arrayWithObject:[NSIndexPath indexPathForRow:row inSection:section]]; 
[self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationNone];
于 2013-03-14T19:37:05.613 に答える