ユーザーが各行を選択したときにセルの背景画像を変更するアプリケーションがあります。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
for (int i = 0; i < [tableView numberOfRowsInSection:0]; i++) {
UITableViewCell *cell = [tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]];
cell.backgroundColor =[UIColor colorWithPatternImage:[UIImage imageNamed:@"white_cell.png"]];
}
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.backgroundColor =[UIColor colorWithPatternImage:[UIImage imageNamed:@"white_cell_check.png"]];
if (indexPath != nil) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
}
「問題なく動作しています。私の問題は、前のビュー、つまりテーブルビュー コントローラーにポップバックするときの詳細ビューからです。テーブルビューの変更された背景画像はそのままです。しかし、私はそれが通常のものである必要があります。誰でもできますか?助けて?