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 11-11-2009, 09:45 AM   #9 (permalink)
jdpmdphd
Registered Member
 
Join Date: Nov 2009
Posts: 3
jdpmdphd is on a distinguished road
Default

If your are using UITextView, and have header interface implementing <UITextViewDelegate> the answer is different than for a textfield. Often it is best to have a button above the keyboard to dismiss it, but you can trigger return from the DONE/return key:
Code:
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range 
 replacementText:(NSString *)text
{
int charINTtyped=0;
	if([text length]>0){
		charINTtyped=(int)[text characterAtIndex:0];
        }
        if(charINTtyped==10){
             [textView resignFirstResponder]; //dismiss the keyboard
             return NO;//don't insert return into textView.text
        }
        return YES;
}
jdpmdphd is offline   Reply With Quote
 

» Advertisements
» Online Users: 568
20 members and 548 guests
.Snipe, cclark, cdbeshore, chrisfromnz, djohnson, Domele, gordo26, iGamesDev, jon01, minglei, ndhieuvn212, nguyenhieu129, Rudy, SuperDietGenius, Techgirl-52, tjfallon, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,319
Threads: 93,989
Posts: 402,412
Top Poster: BrianSlick (7,978)
Welcome to our newest member, st02197
Powered by vBadvanced CMPS v3.1.0

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