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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-15-2009, 01:01 AM   #1 (permalink)
aki
New Member
 
Join Date: Jan 2009
Posts: 7
Unhappy textFieldShouldReturn is not called Probrem

I am creating a app.
But I have a problem.
That is textFieldShouldReturn is not called.

My app use TabBarController.
One of tabs, I use UIViewController. and use protocol UITextFieldDelegate.
That is this.
@interface TokutenViewController : UIViewController <UITextFieldDelegate>{
IBOutlet UITextField *name1;
}

Probrem is in TokutenViewController, textFieldShouldReturn is not called by system, if I push the Done button on SoftKeybord name1 textField.

Why is textFieldShouldReturn method not called ??
I wonder the relatonship bitween UITabBarController and UIViewController.

Thank you.

PS. This is my first post!!
aki is offline   Reply With Quote
Old 02-15-2009, 01:12 AM   #2 (permalink)
Registered Member
 
RickMaddy's Avatar
 
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,122
Default

Did you set the text field's delegate to be the view controller? It doesn't happen automatically.
RickMaddy is offline   Reply With Quote
Old 02-15-2009, 02:04 AM   #3 (permalink)
aki
New Member
 
Join Date: Jan 2009
Posts: 7
Default

Quote:
Originally Posted by RickMaddy View Post
Did you set the text field's delegate to be the view controller? It doesn't happen automatically.
Thank you for your comment.

I already set following code as show my first post.
I wonder I already set UIViewController with UITextFieldDelegate,
but dont call textFieldShouldReturn.:confuse d:

@interface TokutenViewController : UIViewController <UITextFieldDelegate>{
IBOutlet UITextField *name1;
}
aki is offline   Reply With Quote
Old 02-15-2009, 02:11 AM   #4 (permalink)
Tutorial Author
 
Steaps's Avatar
 
Join Date: Oct 2008
Location: Ontario, Canada
Posts: 466
Default

Quote:
Originally Posted by aki View Post
Thank you for your comment.

I already set following code as show my first post.
I wonder I already set UIViewController with UITextFieldDelegate,
but dont call textFieldShouldReturn.:confuse d:

@interface TokutenViewController : UIViewController <UITextFieldDelegate>{
IBOutlet UITextField *name1;
}
In the interface builder, press and hold "ctrl" and click and drag from the TextField to "File's Owner" and select delegate. Remember to save.

Or, since you have the "<UITextFieldDelegate>" line in there, put the following code in the TokutenViewController in ViewDidLoad or, if you declared some properties to the UITextField in another method, put it there.
Code:
name1.delegate = self;

Last edited by Steaps; 02-15-2009 at 02:16 AM.
Steaps is offline   Reply With Quote
Old 02-15-2009, 02:34 AM   #5 (permalink)
aki
New Member
 
Join Date: Jan 2009
Posts: 7
Smile

Quote:
Originally Posted by Steaps View Post
In the interface builder, press and hold "ctrl" and click and drag from the TextField to "File's Owner" and select delegate. Remember to save.

Or, since you have the "<UITextFieldDelegate>" line in there, put the following code in the TokutenViewController in ViewDidLoad or, if you declared some properties to the UITextField in another method, put it there.
Code:
name1.delegate = self;

Thanks All.
I can do it!!
I must do connect delegate and TextField using IB.
aki is offline   Reply With Quote
Old 02-15-2009, 02:40 AM   #6 (permalink)
Tutorial Author
 
Steaps's Avatar
 
Join Date: Oct 2008
Location: Ontario, Canada
Posts: 466
Default

Quote:
Originally Posted by aki View Post
Thanks All.
I can do it!!
I must do connect delegate and TextField using IB.
Does this mean you got it working?
Nice .
Steaps is offline   Reply With Quote
Old 03-21-2010, 12:18 PM   #7 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 5
Thumbs up It fixed mine

Quote:
Originally Posted by Steaps View Post
Does this mean you got it working?
Nice .
Not sure about him, but it fixed a text field I was having the same problem with.
Lane is offline   Reply With Quote
Old 06-08-2010, 11:49 AM   #8 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 8
Default

Fixed a problem for me as well.
spikesnet is offline   Reply With Quote
Reply

Bookmarks

Tags
uitabbarcontroller, uitextfielddelegate

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 249
21 members and 228 guests
@sandris, ADY, bookesp, ckgni, dacapo, Dani77, DarkAn, Davey555, Desert Diva, HemiMG, iDifferent, jakerocheleau, JasonR, LEARN2MAKE, prchn4christ, Rudy, ryantcb, Speed, themathminister, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,766
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:41 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0