Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-16-2009, 05:32 PM   #9 (permalink)
megatron
Registered Member
 
Join Date: Jun 2009
Posts: 4
Default

Quote:
Originally Posted by incorrect.user View Post
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.
megatron is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,743
Threads: 89,197
Posts: 380,553
Top Poster: BrianSlick (7,129)
Welcome to our newest member, JohnS.
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:34 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.