Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
Hi There,

I have 7 textfields placed in a uitableview. I have the return key type of keyboard as default.

When the user selects the first textfield and enter some data & press return key of the keyboard, the focus has to move to next textfield which is placed in the next row.

I googled a lot & i could not find a proper solution for this.

Can you guys help me on this?


Thanks in Advance!:)
 

mccannmarc

macrumors 6502
Aug 15, 2008
270
0
Manchester, UK
You will need to make your class a UITextField delegate and then implement the

Code:
- (BOOL)textFieldShouldReturn:(UITextField *)textField

callback. Within the callback you can set the next textfield to be the first responder or whatever. It will be much easier to manage if you have your 7 textfields as an array as you can just increment the index of the array then to set the next one as first responder. When you reach the end of the textfields you can either just loop it around or make the submit button or whatever the first responder.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.