In the Builder interface, have you checked the "Clear When Editing Begins" checkbox? When checking, the text box should clear any value after using the taps for editing, which is the behavior that I think you are looking for.
You can also set the same property programmatically using cleararsOnBeginEditing, if convenient in your code.
I assume that you did this and it does not behave as you expect. Just check it out as a first step to help you debug.
Also, does this happen in both the Simulator and the test device?
Bart
Edited below ...
That seems weird. Drop everything except the basics of presenting a modal view at application startup and see what happens.
I recreated the most basic application (which I know) to test the view of the modal view controller on startup and to verify that editing the fields works fine. What happens to you when you do the same / similar in a new project?
That's what I'm doing:
1) Create a new application based on the view in Xcode called "ModalViewTest"
2) Create a new UIViewController with xib called ModalViewController
3) In ModalViewController.h add a method
-(IBAction)closeModalView;
4) In ModalViewController.m add an implementation of the method as
-(IBAction)closeModalView { [self dismissModalViewControllerAnimated:YES]; }
5) In ModalViewController.xib, create two text fields and set the placeholder text for each in abcd1234 and make sure that the "Clear when editing" checkbox is selected.
6) In the ModalViewController.xib add the “Close” button and set “Touch Inward” to launch the “closeModalView”
7) In application deletion (ModalViewTestAppDelegate) add the following import
#import "ModalViewController.h"
8) In the applicationate application (ModalViewTestAppDelegate) applicationDidFinishLaunching, add the following after the line containing [window makeKeyAndVisible];
ModalViewController *modalViewController = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil]; [viewController presentModalViewController:modalViewController animated:YES];
9) Save all
10) Create and run this new application
Is editing text fields as expected? If so, what is the difference between the way you build and present your modalView? If not, then we will need to dig further to determine what is happening in your environment.
Second edit below ...
When creating a navigation-based application, I did the following to present a modal view when the application starts. Does this work for you both in the test application and in your real application?
- (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after app launch [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; ModalViewController *modalViewController = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil]; [navigationController presentModalViewController:modalViewController animated:YES]; }