Мне бы очень хотелось временно выделить UITableViewCell, чтобы обратить внимание на тот факт, что содержащиеся в нем данные изменились.
есть метод UITableViewCell: -setHighlighted: (BOOL) animated: (BOOL), но я не могу заставить его что-либо делать?
Вот соответствующая часть контроллера вида:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell;
switch (indexPath.section) {
case 0: {
if (indexPath.row == 0) {
cell = [[UITableViewCell alloc ] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"currentLoc"];
cell.accessoryType = UITableViewCellAccessoryNone;
cell.textLabel.text = @"This is the special cell";
}
[cell setHighlighted:YES animated:YES];
[cell setHighlighted:NO animated:YES];
//[cell setNeedsDisplay];
} else {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"setLocAutomatically"];
cell.accessoryType = UITableViewCellAccessoryNone;
cell.textLabel.text = @"Foo";
}
} break;
case 1: {
cell = [[UITableViewCell alloc ] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"selectCity"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
if (indexPath.row == 0) {
cell.textLabel.text = @"Select a Bar";
} else {
cell.textLabel.text = @"Select a Baz";
}
} break;
}
[cell autorelease];
return cell;
}
См. [Cell setHighlight ...] выше для моей попытки.
К моему разочарованию, клетка не выделяется, и я не нашел способа заставить ее работать.
Спасибо,
Карл С-М