Я создаю textField динамически с помощью следующего кода:
for (int i=0; i<count_size; i++) {
//UITextfield in UIview
CGRect myTextField = CGRectMake(8, 5, 60, 30);
UITextField *txtField = [[UITextField alloc] initWithFrame:myTextField];
[txtField setBorderStyle:UITextBorderStyleRoundedRect];
[txtField setTextColor:[UIColor blackColor]];
[txtField setFont:[UIFont systemFontOfSize:20]];
[txtField setDelegate:self];
txtField.returnKeyType = UIReturnKeyNext;
[txtField setPlaceholder:@"0"];
txtField.keyboardType = UIKeyboardTypeNumberPad;
[myFirstView addSubview:txtField];
}
Теперь я хочу получить значение, введенное в текстовые поля.
Я узнал о протоколе делегата для UITextField.
- (void)textFieldDidEndEditing:(UITextField *)textField {
NSLog(@"Dic: %@",textField.text);
}
Но я не могу реализовать, как хранить эти значения в индексе, в котором они были созданы, как я хочу, чтобы первый textField был сохранен в индексе 0 массива и так далее. Есть идеи?