ios - UITableVIew didSelectRowAtIndexPath inside VIewController not working -


i added code viewcontroller class under (#pragma mark - uitableviewdelegate methods)

- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {      uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath];      nslog(@"selected cell = %@", cell.textlabel.text);      [tableview reloadrowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationnone];      nslog(@"row = %ld", indexpath.row); } 

i want display text select it's not working. ideas i'm doing wrong?

full code here: ios 8 objective-c search bar , table view using google autocomplete

thanks help!

edit: added following code:

viewdidload method (viewcontroller.m)

_tableview.allowsselectionduringediting = yes; _tableview.delegate = self; _tableview.datasource = self; 

changed viewcontroller.h code from

@interface viewcontroller : uiviewcontroller 

to

@interface viewcontroller : uiviewcontroller <uitableviewdelegate, uitableviewdatasource> 

in viewdidload set delegates

_table.delegate = self; _table.datasource = self; 

in interface declare protocols

@interface viewcontroller : uiviewcontroller <uitableviewdelegate, uitableviewdatasource> 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -