Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Can only display 12 bubbles at a time? #6

Closed
markrickert opened this issue Jun 30, 2011 · 5 comments
Closed

Can only display 12 bubbles at a time? #6

markrickert opened this issue Jun 30, 2011 · 5 comments
Labels

Comments

@markrickert
Copy link
Contributor

I'm having an issue with adding more than 12 bubbles to a chat window.

I took the demo project and changed the values of the display and as you can see, after 12, it starts over again at 1.

Any idea on how to fix this? Even a Hint, and i can likely do it myself, but i'm stuck in a rut with debugging this.

Example

@markrickert
Copy link
Contributor Author

It also does some WEIRD things when you scroll up and down... all the cell positions and numbers change... I think there's an issue with the cell re-use and dequeueing

@markrickert
Copy link
Contributor Author

So it works perfectly if i change line 121 of SSMessagesViewController.m from

cell = [[[SSMessageTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];

to

cell = [[[SSMessageTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];

Essentially removing the cell re-use, which is horrible for memory management. So this issue is definitely related to the reuse of the cells.

@soffes
Copy link
Owner

soffes commented Jul 25, 2011

Weird. Definitely a bug. I'll look into it when I get time. Feel free to fork, fix, and send a pull request :)

@andyburke
Copy link

Add calls to:

[_bubbleView setNeedsDisplay];

so they become:

  • (void)setMessageStyle:(SSMessageStyle)aMessageStyle {
    _bubbleView.messageStyle = aMessageStyle;
    [_bubbleView setNeedsDisplay];
    }
  • (void)setMessageText:(NSString *)text {
    _bubbleView.messageText = text;
    [_bubbleView setNeedsDisplay];
    }

In the SSMessageTableViewCell setters for messageStyle and messageText.

I'd submit a patch, but I don't have a good fork, sorry.

@markrickert
Copy link
Contributor Author

Fixed and pull request sent. Thanks andy!

soffes added a commit that referenced this issue Aug 22, 2011
Fix to Issue #6. Props andyburke
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants