RETableViewManager icon indicating copy to clipboard operation
RETableViewManager copied to clipboard

Click cell detailLabelText will disapear

Open xl9211 opened this issue 11 years ago • 5 comments

I create Item below: RETableViewItem *testItem = [[RETableViewItem alloc] initWithTitle:@"test" accessoryType:UITableViewCellAccessoryNone selectionHandler:^(RETableViewItem *item) { [item reloadRowWithAnimation:UITableViewRowAnimationAutomatic]; }]; testItem.detailLabelText = @"test"; testItem.selectionStyle = UITableViewCellSelectionStyleNone; testItem.style = UITableViewCellStyleValue1; [section addItem:testItem];

When click on cell, detailLabelText will disappear. Then click again, detailLabelText will appear.

xl9211 avatar Oct 11 '14 03:10 xl9211

Please forgive my ignorance, but what's the issue?

max-horvath avatar Oct 13 '14 07:10 max-horvath

DetailLabelText should be display. But now, when I click on cell, detailLabelText will disappear.

xl9211 avatar Oct 15 '14 06:10 xl9211

Error in commit https://github.com/romaonthego/RETableViewManager/commit/3cdf6c02fa98c6021f59923dc22dc5b4a2cb2611

if (cell == nil) {
    cell = [[cellClass alloc] initWithStyle:cellStyle reuseIdentifier:cellIdentifier];

    [self.tableView registerClass:cellClass forCellReuseIdentifier:cellIdentifier];

    loadCell(cell);
}

registerClass don't save style!!

Fix — remove useless optimization in RETableViewManager.m: 217 [self.tableView registerClass:cellClass forCellReuseIdentifier:cellIdentifier];

fanruten avatar Oct 31 '14 05:10 fanruten

@fanruten Thanks,it seems OK.

xl9211 avatar Nov 25 '14 16:11 xl9211

Another solution is to set the cellIdentifier on each item: firstNameItem!.cellIdentifier = "LastNameCell". This would mean only the one cell would exist at any time for each use. The issue is that when UITableView creates new cells for reuse identifiers it doesn't use the same style, so registering them for reuse is pointless. Using nibs would also be a solution, as that allows for changing the cell style.

ryanmasondavies avatar Mar 07 '15 11:03 ryanmasondavies