양식을 만들고 있는데 테이블 셀에서 UITextField 값을 검색하는 방법을 아는 사람이 있는지 궁금해하고있었습니다.표 셀에서 데이터 액세스
- (IBAction)saveForm:(id)sender {
NSLog(@"TextField Value => %@", titleField.text);
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...
switch(indexPath.section)
{
case 0:
if (row == 0) {
cell.selectionStyle = UITableViewCellSelectionStyleNone;
CGRect titleFieldFrame = CGRectMake(20.0, 80.0, 280.0, 25.0);
UITextField *titleField = [[UITextField alloc] initWithFrame:titleFieldFrame];
[titleField setBorderStyle:UITextBorderStyleRoundedRect];
[titleField setTextColor:[UIColor blackColor]];
[titleField setFont:[UIFont systemFontOfSize:16]];
[titleField setPlaceholder:@"Title"];
[titleField setBackgroundColor:[UIColor whiteColor]];
titleField.keyboardType = UIKeyboardTypeDefault;
titleField.returnKeyType = UIReturnKeyDone;
[cell addSubview:titleField];
}
break;
return cell;
}
효과가있었습니다. 나는 setTag에 관해 몰랐다. 그러나 나는 그것에 관해 더 많이 조사 할 것이고, 그것이 사용될 수 있었던 방법을 다른 방법으로 볼 것이다. DarkDust에게 감사드립니다. –