버튼을 클릭 할 때 tableview 텍스트 필드 값을 얻었습니다. 많은 시도를했지만 가치를 얻을 수 없습니다. 나 항상 여기 버튼에
클릭에 루프 실행에 대해,이 null 값을 인쇄의 내 코드하지만이 코드는 IOS 7 simulater에서 일하고 있지만 IOS 작업 (8)는 나에게Tableview의 iOS 텍스트 필드 for 루프의 값이 ios 7에서 작동하지 않지만 iOS 8에서 작동 함
for (int k=0; k< aryModifier.count; k++) {
// NSLog(@"--%d",i);
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:k inSection:0];
UITableViewCell *cell = [[self tbl_itemModifier] cellForRowAtIndexPath:indexPath];
UITextField *getTextView = (UITextField*)[cell.contentView viewWithTag:200];
//for (UIView *subView in cell.subviews)
for (UIView *subView in cell.contentView.subviews)
{
if ([subView isKindOfClass:[UITextField class]])
{
UITextField *txtField = (UITextField *)subView;
NSLog(@"%@",txtField.text);
}
}
//UITextField *getTextView = (UITextField*)[cell.contentView viewWithTag:i];
NSLog(@"%@",getTextView.text);
}
도와주세요 표 Cellforrow되지 않는다 인덱스 경로에서
UITextField *txt=[[UITextField alloc]initWithFrame:CGRectMake(180, 40, 50, 15)];
txt.text = @"1";
txt.textAlignment = NSTextAlignmentCenter;
txt.font=[UIFont systemFontOfSize:12];
txt.textColor = [UIColor blackColor];
txt.tag = 200;//indexPath.row;
txt.delegate = self;
NSString *str = txt.text;
[cell addSubview:txt];
y는 양방향이지만 성공하지 못합니다. 당신이 어떤 데모 링크가 있다면 나와 함께 공유하시기 바랍니다 ...
//for (UIView *subView in cell.subviews)
for (UIView *subView in cell.contentView.subviews)
나에게 해결책을주십시오 ......... 를 도와주세요