Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-16-2009, 04: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
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 280
19 members and 261 guests
cakesy, camtadao, crooksy88, Erle, Eskema, Falcon80, ghanalupo, jojo453, josh, kiancheong, mixer555, odysseus31173, SalvoMaltese, shay_somech, SkodaBuddy, StefanL, Stitch, Susan03, thadre
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,280
Threads: 39,072
Posts: 171,337
Top Poster: smasher (2,575)
Welcome to our newest member, Susan03
Powered by vBadvanced CMPS v3.1.0

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