Quote:
Originally Posted by incorrect.user
 I thought i need only to setup an empty callback (ie IBAction) for "Did End On Exit" event of the UITextField (as IBOutlet) in the InterfaceBuilder!
Like this:
//header
@interface MyView : UIView
{
IBOutlet UITextField *name;
}
And the keyboard will be hidden after editing is complete.
And the keyboard will be hidden after editing ends.
- (IBAction)doneButtonOnKeyboardPressed: (id)sender;
//m-file
@implementation MyView
- (IBAction)doneButtonOnKeyboardPressed: (id)sender
{}
@end
|
If you haven't sorted it out yet you do the following:
In your .h file type:
Code:
@interface WhatEverViewController : UIViewController <UITextFieldDelegate> {
IBOutlet UITextField * firstTextField;
IBOutlet UITextField * secondTextField;
IBOutlet UITextField * doneButtonPressed;
}
@property (nonatomic, retain) IBOutlet UITextField * firstTextField;
@property (nonatomic, retain) IBOutlet UITextField * secondTextField;
@property (nonatomic, retain) IBOutlet UITextField * doneButtonPressed;
@end
In your .m file add the following: (replace with your own info)
Code:
@synthesize firstTextField, secondTextField, doneButtonPressed;
- (BOOL)textFieldShouldReturn:(UITextField *)doneButtonPressed {
NSLog(@"Keyboard Done Pressed");
[doneButtonPressed resignFirstResponder];
return YES;
}
In you nib file select your UITextField and make the delegate the FilesOwner, do this for all TextFields and the keyboard will hide when the done button is pressed.