ios4 - UITableviewCell with RemoveButton -


i have 1 tableview in added uibutton each tableviewcell named remove when click remove button appropriate cell data remove tableview

and added uibutton programmatically

now want perform remove option.

thanks in advance....

try one:

    - (uitableviewcell *)tableview:(uitableview *)atableview cellforrowatindexpath:(nsindexpath *)indexpath {         static nsstring *s = @"cell";           uitableviewcell *cell = (uitableviewcell *)[tableview dequeuereusablecellwithidentifier:s];         asyncimageview *asyncimage;         uibutton *button = nil;         if ( cell == nil ) {             cell = [[[uitableviewcell alloc]initwithreuseidentifier:s] autorelease];             uibutton *removebtn = [uibutton buttonwithtype:uibuttontypecustom];         [button addtarget:self                         action:@selector(remove:)               forcontrolevents:uicontroleventtouchupinside];             ….             [cell addsubview:button];         }          …..             return cell;     }      -(void)remove:(uibutton*)btn{         uitableviewcell *cell = (uitableviewcell *)btn.superview;         nsindexpath* index = [self.tableview indexpathforcell:cell];         [peoplelist removeobjectatindex:index.row];         [self.tableview deleterowsatindexpaths:[nsarray arraywithobject:index]                       withrowanimation:uitableviewrowanimationright]; } 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -