How to make the keyboard go away in the iphone simulator

To dismiss keyboard you can use TextField Delegate.

To use this follow these steps...
1. In you viewController.h add the delegate declaration like this:

@interface ViewController : UIViewController <UITextFieldDelegate> {
    }
2. In your viewController.m call this method:
- (BOOL)textFieldShouldReturn:(UITextField *)textField
3. Then write a code like this:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    [textField resignFirstResponder];
    return YES;
    }
4. Final step is to set the textField's delegate:
- (void)viewDidLoad {
        [super viewDidLoad];
        self.textField.delegate = self;
    }

One way to do it is to set an object as the delegate to the text field and implement

- (BOOL)textFieldShouldReturn:(UITextField *)textField

in which you call [textField resignFirstResponder]

This will cause the keyboard to disappear when they push the return/go/done button (whatever you set the bottom right keyboard key to be).

See the UITextFieldDelegate reference for more info.