iphone - change return key type of last dynamic generated textfield -


i generating 4 dynamic uitextfield return key type next , when press next focus gets transferred next uitextfield want when 4th uitextfield gets focus return key type must change done when pressed must resign first responder.

for implementing "next" functionality using code

nsuinteger currentindex = [feilds1array indexofobject:textfield];         if(currentindex>=feilds1array.count-1)         {              nslog(@"change return key type...");         }         else         {             uitextfield* nexttextfield1 = (uitextfield*)feilds1array[currentindex+1] ;             [nexttextfield1 becomefirstresponder] ;         } 

this might easy 1 not able figure out newbie
please me out
in advance...

do this,

in textfield delegate method,

access 4th textfield using tag value or did already,

- (void)textfielddidbeginediting:(uitextfield *)textfield {      if([textfield isequal:textfield4])           textfield4.returnkeytype = uireturnkeydone; }  - (bool)textfieldshouldreturn:(uitextfield *)textfield {      if([textfield isequal:textfield4])           [textfield resignfirstresponder];      return yes; } 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -