我有更多内容UITextField
,UITableViewCell
但是当我向下滚动并返回时,它UITextField
是空的。有没有办法不自动重置?
这是代码:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cella"];
if(cell==nil){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cella"];
}
cell.textLabel.text = [dati objectAtIndex:indexPath.row];
UITextField *testo = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 150, 31)];
testo.borderStyle = UITextBorderStyleRoundedRect;
testo.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
testo.placeholder = @"Inserisci del testo..";
testo.delegate = self;
cell.accessoryView = testo;
return cell;
}