AlexBarinov/UIBubbleTableView

Sometimes text doesn't appear?

Macro206 opened this issue · 5 comments

Sometimes the text in the bubble doesn't appear. This happens very often. Any ideas?
I've noticed that the bubble appears and stretches correctly based on the text - it's just that the text doesn't display.

I am also seeing this problem and can't figure out why. Sometimes the text just appears a few seconds later.

Could it have to do with some UI code no running on the main thread?

I've been seeing this intermittently since iOS7 as well. I'm using a heavily modified subclass of HPLChatTableViewCell and I assumed that I broke something, but this sounds like behavior I've encountered.

Same problem here. Any solutions yet?

I'm also running some code out of the main thread, but when I log the content of the cell everything seems to be ok and the data is already available.

ihla commented

I was facing the same issue when I scroll down/up the rows and then dismissed the keyboard some texts disappeared, I was able to reproduce it quite easy. I found out that the UILabel was not in the view hierarchy of the UITableViewCell when the text disappeared. There are similar issues discussed on the stackoverflow and one recommended solution is to use view tag along with the views which are dynamically added/removed - I tried it and it worked. The code snippet is like this:

[[self.contentView viewWithTag:kCustomViewTag] removeFromSuperview];
self.customView = data.view;
self.customView.tag = kCustomViewTag;
[self.contentView addSubview:self.customView];

Below is a similar fix that works for me.

- (void)prepareForReuse
{
    [super prepareForReuse];

    if (self.customView.superview == self.contentView) {
        [self.customView removeFromSuperview];
    }
    self.customView = nil;
}