Open apoon opened 11 years ago
What do you mean by X?
The code looks good. Try clicking directly from one UITextField to the second UITextField. You may notice that the Done button unexpectedly disappears.
To fix that issue, try to use the following UITextField delegate method:
- (void)textFieldDidBeginEditing:(UITextField *)textField {
self.navigationItem.rightBarButtonItem =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
target:self action:@selector(onDoneButton)];
}
To understand why that works, try adding NSLog messages in all the UITextField delegate methods. Then, try switching between the text fields and watch the order that the delegate methods are called.
My app is a complete, please review. Also, I have a question about X, is that the right way to do it? /cc @nesquena @timothy1ee