Я использую таблицу для редактирования атрибутов модельного объекта (экземпляр аннотации). Ячейки в таблице соответствуют различным атрибутам класса Annotation:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellAnnotation"];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:@"cellAnnotation"] autorelease];
}
[[cell textLabel] setText:@"Category"];
categoryField = [[UITextField alloc] initWithFrame:CGRectMake(90, 8, 200, 25)];
[categoryField setAutocorrectionType:UITextAutocorrectionTypeNo];
[categoryField setFont:[UIFont fontWithName:@"Verdana" size:15]];
[categoryField setText:[[annotation category] name]];
[categoryField setDelegate:self];
[[cell contentView] addSubview:categoryField];
[categoryField release];
return cell;
Удивительно, но если я перезагружаю данные в методе контроллера viewWillAppear, то получаю странное поведение: символы в UITextField не будут очищены при нажатии клавиши возврата, хотя их нет при отставке первого респондента в UITextField и извлекая его текстовое свойство. Может кто-нибудь мне помочь? Заранее спасибо.