ios - UITableViewCell edit cell content on click -


i have question uitableviewcell's.

i have implemented uitableviewdelegate method

- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {     uitableviewcell *cell = [self tableview:tableview cellforrowatindexpath:indexpath];      cell.backgroundcolor = [uicolor redcolor];     cell.textlabel.textcolor = [uicolor redcolor];     cell.textlabel.text = @"title"; } 

after click on desired cell, nothing happens...

why doesn't work expected? also, should make work?

try this:

- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {     uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath];     // config selected cell     .... } 

you should ask uitableview cell directly rather ask delegate (self in code). cause delegate may dequeue or create fresh cell rather giving cell seleceted.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -