ios - UITableViewCell subclass: Delete and reorder button not showing -
i using uitableviewcell subclass in highly customized uitableview. want implement edit button. implemented button, action, setting uitableview editing:yes , on. problem cells not show delete or move buttons or handlers. need implement in subclass this?
bests,
philip
do complete implementation of edit , delete buttons in tableview, customize according requirement
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *simpletableidentifier = @"referrral remaindercc"; referrralremaindercc *cell = (referrralremaindercc *)[tableview dequeuereusablecellwithidentifier:simpletableidentifier]; if (cell == nil) { uiviewcontroller *c = [[uiviewcontroller alloc] initwithnibname:@"referrralremaindercc" bundle:nil]; cell = (referrralremaindercc *) c.view; } if (dataarray.count==0) { return 0; } else { referraldc *referral =[dataarray objectatindex:indexpath.row]; cell.lbldate.text = referral.referraldc_date; cell.lblcompanyname.text = referral.referraldc_companyname; cell.lblemail.text = referral.referraldc_emailtelephone; cell.lblfellowupdate.text = referral.referraldc_fellowupdate; cell.lblreferralrequest.text =referral.referraldc_referralrequest; cell.lblname.text = referral.referraldc_name; cell.edit.tag = indexpath.row; cell.delete.tag = indexpath.row; [cell.edit addtarget:self action:@selector(btntapped:withevent:) forcontrolevents:uicontroleventtouchupinside]; [cell.delete addtarget:self action:@selector(btntapped:withevents:) forcontrolevents:uicontroleventtouchupinside]; } return cell; } - (void)btntapped:(id)sender withevent:(uievent*)event { uitouch *touch = [[event alltouches] anyobject]; cgpoint location = [touch locationinview:self.tblview]; nsindexpath *indexpath = [self.tblview indexpathforrowatpoint:location]; referraldc *referral =[dataarray objectatindex:indexpath.row]; referalid = referral.referraldc_referralid; txtdate.text = referral.referraldc_date; txtcompanyname.text = referral.referraldc_companyname; txtemail.text = referral.referraldc_emailtelephone; txtfolowupdate.text = referral.referraldc_fellowupdate; txtviewreferralrequest.text =referral.referraldc_referralrequest; txtname.text = referral.referraldc_name; btneditpressed=1; }
Comments
Post a Comment