Iphone 添加带有标记的动态文本字段第2部分

Iphone 添加带有标记的动态文本字段第2部分,iphone,Iphone,我想动态添加带有标记的textfield,这样它每次都能给出唯一的值。然后添加这些值,并希望在标签上显示。。。。当我单击按钮时,一个文本字段addn给出值,该值将添加到上一个值中 增值成功。。。但是,当我编辑任何内容、更改或给出另一个值(如(10而不是12)时,由于这一行,循环将再次运行 [Txt_New_Estimated addTarget:self action:@selector(C6Loop)for ControlEvents:uicontrolEventEditingDiEnd] 第

我想动态添加带有标记的textfield,这样它每次都能给出唯一的值。然后添加这些值,并希望在标签上显示。。。。当我单击按钮时,一个文本字段addn给出值,该值将添加到上一个值中

增值成功。。。但是,当我编辑任何内容、更改或给出另一个值(如(10而不是12)时,由于这一行,循环将再次运行

[Txt_New_Estimated addTarget:self action:@selector(C6Loop)for ControlEvents:uicontrolEventEditingDiEnd]

第二个问题是,当我添加新的文本字段时,之前的文本字段并没有被修改,并且并没有添加到其余的文本字段中。。。在添加新文本字段之前,它可以正常工作,但在编辑任何内容时,循环将再次运行。。。。我想克服这个问题,所以请检查此代码并给出一些可能的解决方案。。。我正在发送我的代码,请检查此代码

谢谢你

-(void)CreateTextFeildOnRun
{
if (tag ==0)
{
    textPosY = 420;
}
for ( i =tag; i<= tag; i++) 
{
Txt_New_Estimated = [[UITextField alloc]initWithFrame:CGRectMake(360, textPosY , 130,         65)];
    Txt_New_Estimated.delegate = self;
    Txt_New_Estimated.text=@"";
   //[Txt_New_Estimated setTag:1234];
    Txt_New_Estimated.tag = i; 
    Txt_New_Estimated.clearButtonMode = UITextFieldViewModeWhileEditing;
    [Txt_New_Estimated addTarget:self action:@selector(C6Loop)    forControlEvents: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];

}
}

-(void)C6Loop{
Txt_New_ONU.text=Txt_New_Estimated.text;
[self Calculate2];

}

-(void)Calculate2{
int y14=([Txt_New_Estimated.text intValue]);
y14=n;
n=d;

c14=  y14+([Txt_New_Estimated.text floatValue]);

n  = c14;
[self addest];
}


-(void)addest{

float c1= ([Txt_Engring_Est.text floatValue]) + ([Txt_Weddring_Est.text floatValue]) +  ([Txt_Bridal_Est.text floatValue])+ ([Txt_Veil_Est.text floatValue])+ ([Txt_Shoe_Est.text  floatValue])+n;
Txt_Total_Est.text = [[NSString alloc] initWithFormat:@"%.2f",c1];
}
-(void)CreateTextFeildOnRun
{
如果(标记==0)
{
textPosY=420;
}

对于(i=tag;i请检查此行可能有问题。 您正在为i变量指定相同的值,并且限制也相同

for ( i =tag; i<= tag; i++) 

for(i=tag;i)您的初始标记值是多少?