I have created 2 `UITextField`s and a `UIButton` programmatically, when I click the `UIButton` I want it to change the text of the highlighted `UITextField` but it's changing the text of the second `UITextField` not the highlighted one.

```
-(void)viewDidLoad
{
    txtf = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 586, 45)];
    txtf.borderStyle = UITextBorderStyleNone;
    txtf.backgroundColor = [UIColor clearColor];
    txtf.font = [UIFont systemFontOfSize:17];
    txtf.autocorrectionType = UITextAutocorrectionTypeNo;
    txtf.keyboardType = UIKeyboardTypeDefault;
    txtf.returnKeyType = UIReturnKeyDone;
    txtf.textAlignment = NSTextAlignmentLeft;
    txtf.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    [self.view addSubview:txtf];

    txtf = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 586, 345)];
    txtf.borderStyle = UITextBorderStyleNone;
    txtf.backgroundColor = [UIColor clearColor];
    txtf.font = [UIFont systemFontOfSize:17];
    txtf.autocorrectionType = UITextAutocorrectionTypeNo;
    txtf.keyboardType = UIKeyboardTypeDefault;
    txtf.returnKeyType = UIReturnKeyDone;
    txtf.textAlignment = NSTextAlignmentLeft;
    txtf.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    [self.view addSubview:txtf];
}

- (IBAction)change:(id)sender 
{
    txtf.text = @"the text was changed"
}

```

is there any way to solve this problem?