ios - How to access UIButton (or any UIElement) inside UITableViewHeaderFooterView subclass? -
i'm learning uitableview in objective-c. hint me how access uibutton inside uitableviewheaderfooterview subclass uiviewcontroller class? programatically, don't use ib.
full code: https://gist.github.com/tomnaz/3d790b308d305af8b98c
[[??? btnedit] addtarget:self action:@selector(addnewitem:) forcontrolevents:uicontroleventtouchupinside];
don't in viewdidload, in viewforheaderinsection: have pointer header view.
- (uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section { static nsstring *headerreuseidentifier = @"tableviewsectionheaderviewidentifier"; itemsheaderview *sectionheaderview = [tableview dequeuereusableheaderfooterviewwithidentifier:headerreuseidentifier]; [sectionheaderview.btnedit addtarget:self action:@selector(addnewitem:) forcontrolevents:uicontroleventtouchupinside]; return sectionheaderview; }
Comments
Post a Comment