I want to generate textfields dynamically in my app scenario is I am having a textfield and a button if entered the number 2 in textfield and pressed the button, then 2 texfields must be generated on view controller
You can achieve this using this code;
int num=yournum;
for (int i = 1; i <= num; i++) {
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(...)];
textField.tag = i;
...
[self.view addSubview:textField];
}
And to access the correct text field afterwards you'd call
[self.view viewWithTag:tag]
.