Когда мы получили сообщение на Facebook Mesenger, текст становится полужирным в UITableViewCell после касания ячейки и просмотра сообщения, а затем возвращается в UITableView, текст ячейки больше не выделен жирным шрифтом.Как сделать UITableViewCell текст, как Facebook Messenger для iOS?
Как создать это поведение?
Ниже мой код:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
.
.
.
//Implementation
.
.
.
[[fetchedObjects objectAtIndex:indexPath.row ] setValue:@"1" forKey:@"lido"];
NSError*error;
// Escreve no banco a alteração
[context save:&error];
for (int index = 0; index<[fetchedObjects count]; index++) {
NSLog(@"%@",[[fetchedObjects objectAtIndex:index]valueForKey:@"lido"]);
.
.
.
// Implementation
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
.
.
.
//Implmentation
.
.
.
if ([[arrayProcessosLocal objectAtIndex:indexPath.row ] valueForKey:@"lido"] == 1) {
//Torna fonte bold
cell.textLabel.font = [UIFont boldSystemFontOfSize:17];
[cell.textLabel setText:[NSString stringWithFormat:@"%@ - %@", [processosLocal valueForKey:@"processo"],[processosLocal valueForKey:@"data_pdf"]]];
return cell;
}else{
// Exibe a fonte normal caso o valor de "lido" seja 0 (zero)
[cell.textLabel setText:[NSString stringWithFormat:@"%@ - %@", [processosLocal valueForKey:@"processo"], [processosLocal valueForKey:@"data_pdf"]]];
return cell;
}
ОК я отправлю код ... –
HI! Я отправляю код! –