so in my app, i click a button and i dynamically add a UITextField:
myRect = CGRectMake(4, viewYPos, 80, 25);
UITextField *myTextField = [[UITextField alloc] initWithFrame:myRect];
myTextField.borderStyle = UITextBorderStyleRoundedRect;
myTextField.font = [UIFont fontWithName:@"Trebuchet MS" size:12];
myTextField.returnKeyType = UIReturnKeyDone;
myTextField.delegate = self;
[myTextField addTarget:self
action:@selector(textFieldShouldReturn:)
forControlEvents:UIControlEventEditingDidEndOnExit];
[attributeScrollView addSubview:myTextField];
[myTextField release];
now, how do i reference this text field? is there a way to pull it out of the view and place it back into a new textfield variable?
my only thought is to create an instance nsarray variable so i can keep their reference.
Make myTextField an instance variable instead of local. Then, don’t release it.