Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
RemindMeViewController.h

Code:
@interface RemindMeViewController : UIViewController  {

	UITextField *reminderText;

}
@property (nonatomic,retain) IBOutlet UITextField *reminderText;
RemindMeViewController.m

Code:
@implementation RemindMeViewController

@synthesize reminderText;
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
	
	[reminderText resignFirstResponder];
	return YES;
}
I then open .xib and set delegate of ViewController to the UITextField, and set the Outlet for the UITextField to reminderText. When I click Done on the keyboard, nothing happens. What's going on here?
 
then open .xib and set delegate of ViewController to the UITextField

I think this should be the other way around, set the delegate of the UITextField to the ViewController.

Setting a breakpoint in this method should tell you if it's hooked up right.
 
You can set a transparent button across the view that will send it back down again with resignFirstResponder
 
That is not that neatly solved then..
Best way is to use delegates, or check a touch outside the keyboard to dismiss the keyboards.

Do you have an example to check for touch outside of keyboard?

I learned it the untidy way and have stuck with it, but I think everyone aims for tidier code =)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.