objective c - IOS delete/hide table row section and cells? -
ive been struggling on couple of days trying number of different ways trying remove sections of table view.
exportsettings.h
@property (weak, nonatomic) iboutlet uitableviewrowaction *movemberfeatures;
this connected movember section.
exportsettings.m
- (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { uitableviewcell* cell = [super tableview:tableview cellforrowatindexpath:indexpath]; if(cell == self.movemberfeatures) return 0; //set hidden cell's height 0 return [super tableview:tableview heightforrowatindexpath:indexpath]; }
currently not building , not sure why. great
if(cell == self.movemberfeatures)
you trying compare uitableviewcell
uitableviewrowaction
. that's build fail think.
you can see in documentation uitableviewrowaction
defines single action present when user swipes horizontally in table row. not @ suited want do.
use nsinteger
associated section refer it.
as suggested bharat modi, use [tableview deletesections:[nsindexset indexsetwithindex:indexpath.section] withrowanimation:uitableviewrowanimationfade];
delete section table.
Comments
Post a Comment