Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 16, 2008, 08:06 AM   #1
pashik
macrumors member
 
Join Date: Jul 2008
IPhone: UITextField - how to set certain action for return key on keyboard

Hi.

There is view with 2 UITextField and login button.
When user is in password textbox keyboard is shown with return key set as "Go".
How i can set that return key to make action from Login button so user don't need to close keyboard and touch Login button?

Thanx in advance for reply.
pashik is offline   0 Reply With Quote
Old Jul 16, 2008, 08:08 AM   #2
white89gt
macrumors regular
 
Join Date: Jan 2006
You have to set up a UITextField delegate to handle what you're talking about. I don't have any code that I can post up since I'm at work. I could post something later, though.
white89gt is offline   0 Reply With Quote
Old Jul 16, 2008, 08:39 AM   #3
pashik
Thread Starter
macrumors member
 
Join Date: Jul 2008
Quote:
Originally Posted by white89gt View Post
You have to set up a UITextField delegate to handle what you're talking about. I don't have any code that I can post up since I'm at work. I could post something later, though.
It would be great if u show some code.
pashik is offline   0 Reply With Quote
Old Jul 17, 2008, 04:07 AM   #4
pashik
Thread Starter
macrumors member
 
Join Date: Jul 2008
here is code which works:
Code:
// UITextFieldDelegate

- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
	[theTextField resignFirstResponder];
	if(theTextField = myPasswordTextField)
	   [self onLoginButtonClicked];
	return YES;
}
pashik is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Bluetooth keyboard not pairing - return key not working? joaosantos Mac Peripherals 0 Jul 21, 2013 05:41 PM
Can't use action-combo key-bindings in Xcode 4? printz Mac Programming 0 Mar 19, 2013 11:35 AM
How can I set “numbers” to return a specific integer in a set? rotarypower101 Mac Applications and Mac App Store 0 Sep 3, 2012 02:30 PM
XCode 4.4 add action from a VNC key combination megabyzus Mac Programming 0 Aug 6, 2012 09:49 PM
Make the enter key act like the return key qtrim Mac Basics and Help 6 Jul 28, 2012 03:37 PM

Forum Jump

All times are GMT -5. The time now is 12:34 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC