iphone - Need to enable UITextField in row of UITableView when cell is selected in iOS -


i have created custom cell places uitextfield in each row of uitableview. enable uitextfield particular row (i.e. activate cursor in textfield), when user presses on anywhere inside cell.

i have following method try this:

- (void) tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {       [_cell.textfield setuserinteractionenabled:true];  } 

however, not working. can see i'm doing wrong?

you're on right track placing inside didselectrowatindexpath:. however, setting user interaction enabled on textfield means user allowed interact object if tried. you're looking becomefirstresponder.

- (void) tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {     uitableviewcell *cell = [self.tableview cellforrowatindexpath:indexpath];     [cell.textfield becomefirstresponder]; } 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -