我對如何在UITableView中引用文本字段的文本感到非常困惑。我在tableview中有5行沒有文本加載,用戶輸入文本然後保存爲設置。我試圖讓數組_textBox1Contents和_textBox2Contents包含5個textBox1和textBox2文本域中的用戶輸入文本。如何引用特定單元格的文本字段以便使用NSUserDefaults將它們發送到應用程序的其他部分?如何在UITableView的單元格中引用文本字段的文本
在此先感謝。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"TableCell";
TableCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
long row = [indexPath row];
cell.image.image = [UIImage imageNamed:_image[row]];
cell.titleLabel.text = _Title[row];
cell.textbox1.placeholder = _textBox1[row];
cell.textbox2.placeholder = _textBox2[row];
cell.colon.text = _colon[row];
cell.textbox1.delegate = self;
cell.textbox2.delegate = self;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
_textBox1Contents = @[@"",
@"",
@"",
@"",
@"",];
_textBox2Contents = @[@"",
@"",
@"",
@"",
@"",];
return cell;
}
使用性能。 – 2013-12-22 10:26:29