想要使用来自NSMutableArray ....
的标记从动态创建的文本字段中获取值Txt_New_Estimated = [[UITextField alloc]initWithFrame:CGRectMake(360, textPosY , 130, 65)];
Txt_New_Estimated.delegate = self;
Txt_New_Estimated.text=@"";
Txt_New_Estimated.tag = i;
Txt_New_Estimated.clearButtonMode = UITextFieldViewModeWhileEditing;
[Txt_New_Estimated addTarget:self action:@selector(C6Loop) forControlEvents:UIControlEventEditingChanged];//UIControlEventEditingDidEnd
Txt_New_Estimated.placeholder = @"Estimated";
Txt_New_Estimated.font = [UIFont fontWithName:@"Arial" size:23];
Txt_New_Estimated.backgroundColor = [UIColor whiteColor];
Txt_New_Estimated.textAlignment = UITextAlignmentCenter;
[scrollview addSubview:Txt_New_Estimated];
[textFieldArray addObject:Txt_New_Estimated];
如何使用这行代码在每个索引上添加值
[textFieldArray4 addObject:Txt_New_ONU.text]; //值将仅添加零索引
表示只有一个值会从此行中添加...
但我想在textFieldArray4 ....中添加零索引的无限值。
因为我在我的" Txt_New_ONU"上使用了标签。文本框....
如何做到这一点?请提出一些想法......
谢谢......
答案 0 :(得分:0)
您应该检查UITextFieldDelegate中的Txt_New_Estimated.text值。
看看这里:
UITextFieldDelegate Protocol Reference
我建议的方法是:
- (void)textFieldDidBeginEditing:(UITextField *)textField
- (void)textFieldDidEndEditing:(UITextField *)textField