
思路是: 循环 获取到所有cell 的下标. 将图片或按钮的状态全部置未 NO 或 隐藏, 再获取当前点击的 cell. 将图片或按钮 置为 yes
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
for (int i = 0; i < 2; i++) {
NSIndexPath *index = [NSIndexPath indexPathForRow:i inSection:1];
OJBSunriseSunsetTableViewCell *cell = [tableView cellForRowAtIndexPath:index];
cell.selectStatusImageView.hidden = YES;
}
OJBSunriseSunsetTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.selectStatusImageView.hidden = NO;
if (self.selectCityIndex) {
self.selectCityIndex(indexPath);
}
}
网友评论