ios - Why won't my UITableViewCellAccessoryCheckmark display? -
in - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath, had:
if ([uploadmanager isfileuploaded: filename]) cell.accessorytype = uitableviewcellaccessorycheckmark; else cell.accessorytype = uitableviewcellaccessorynone; but, thinking there might bug in uploadmanager, changed to:
if ([uploadmanager isfileuploaded: filename]) cell.accessorytype = uitableviewcellaccessorycheckmark; else cell.accessorytype = uitableviewcellaccessorycheckmark; for testing. however, cells still don't show checkmark. doing wrong?!
thanks!
edit:
it shouldn't matter but, in case, here's whole (most of) cellforindexpath
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"filelist-cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle: uitableviewcellstyledefault reuseidentifier: cellidentifier]; } int row = [indexpath row]; // create cell layout nsstring *filename = [self.tableitems objectatindex: row]; // name label uilabel *namelabel = (uilabel*)[cell viewwithtag: namelabeltag]; if (namelabel == nil) { namelabel = [uilabel new]; // blah blah, snip [cell addsubview: namelabel]; } namelabel.text = filename; [namelabel sizetofit]; cgrect rect = namelabel.frame; rect.origin.x = 50; namelabel.frame = rect; // more ui added cell here. snip // uploaded checkmark if ([uploadmanager isfileuploaded: filename]) cell.accessorytype = uitableviewcellaccessorycheckmark; else cell.accessorytype = uitableviewcellaccessorycheckmark; return cell; }
oh duh! nevermind...
i'd delete question, in future might make same mistake, i'm leaving them.
my client has weird requirement wants table in editing mode, little round, red delete-row buttons showing. hence, had self.tableview.editing = yes; in viewdidload. tableview.editing hides checkmark, , turning off brings back.
d'oh!
i guess i'll have convince him send me checkmark artwork can use in imageview or such.
(i tried convince him not in always-edit mode -- no joy.)
Comments
Post a Comment