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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 10-03-2008, 06:06 PM   #7 (permalink)
frankus
New Member
 
Join Date: Oct 2008
Posts: 1
frankus is on a distinguished road
Default Getting Return Key to Work

I was able to get the return key to work as follows:
  1. Add the UITextFieldDelegate protocol to your controller.
  2. Set the delegate of the UIAlertView's text field to self.
  3. Add the following function:
Code:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
	[(UIAlertView *)[textField  superview] dismissWithClickedButtonIndex:1 animated:YES];
	
	return NO;
}
This will intercept the return key press and use it to dismiss the alert with the "OK" button pressed.
frankus is offline   Reply With Quote
 

» Advertisements
» Online Users: 351
17 members and 334 guests
baja_yu, brainspoon, Creativ, cristofercolmbos, Davor, Domele, iconomania, jbro, mediaspree, Meoz, NSString, speed4mee, spiderguy84, toolifog, TylerBetable, UconnAggie
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,551
Threads: 94,078
Posts: 402,728
Top Poster: BrianSlick (7,990)
Welcome to our newest member, hongto24
Powered by vBadvanced CMPS v3.1.0

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