iphone - doesnt remove cells -
i have custom uitableview
allows user select multiple images. problem delete method isnt working.
i keep track of selected images , when user confirms delete images removed array , table should update.
the call [self.tableview reloaddata]
not removing cells tableview.
how can achieve this? how can call
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {
or similar force table check data source , redraw cells?
looking @ scenario , can perform thing in 2 ways
1)using reloaddata function
while using please make sure 2 thing when choose delete cell first check whether particular record has been deleted @ indexpath want be.
secondly once data deleted array after use [self.tableview reloaddata] or [objectoftableview reloaddata]. way works fine.
but apple has provided methods remove cells table effects.so it's use below way.
2)way prefer use since looks great in app uitableview.
(void)tableview:(uitableview *)tableview commiteditingstyle: (uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath {
if (editingstyle == uitableviewcelleditingstyledelete) {
//over here first delete record array @ indexpath
//[self makelogout]; [self.aclogintblview deleterowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade]; }
[self.aclogintblview reloaddata]; }
hope after giving pain finger solve queries in better way ;)
Comments
Post a Comment