ios - Handle UIButton click in a custom cell that is loaded in sections (where number of section is not defined. ie: taken dynamically) -


i having view controller want load sections & count number of section taken dynamically, ie: retrieved database. now, in each section having 8 rows row 2 8 loaded 5 buttons each. want whenever button on cell pressed particular value manipulated & displayed on extreme right of cell. same thing should happen sections. . problem when click particular button on cell of 1 section; other button on cells of other sections selected well. . please help..

you can section index cell index @ button tap method using bellow code:-

-(ibaction)actionbttontap:(uibutton*)sender {      cgpoint touchpoint = [sender convertpoint:cgpointzero toview:yourtableview];     nsindexpath *indexpath = [tblhistoryyear indexpathforrowatpoint:touchpoint];     nsstring *strsection=[nsstring stringwithformat:@"%d",indexpath.section];     nsstring *strrow=[nsstring stringwithformat:@"%d",indexpath.row];      nslog(@"tag %d   indexpath  %d  section %d",sender.tag,indexpath.section,indexpath.row);  } 

do not forget set button tag @ cellforrowatindexpath self.yourbutton.tag=indexpath.row;


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -