text in tableviewcell being cut short

Discussion in 'iOS Programming' started by dantastic, Mar 22, 2011.

  1. dantastic macrumors 6502a


    Jan 21, 2011
    I have a couple of uitableviews using bog standard uitableviewcells with a UITableViewCellStyleSubtitle style. This style should allow the text label to utilize the full width of the cell.

    I have a few tables where the text is always being trimmed and then I've another table where it is all correct - the code is identical. I must have done something somewhere but I can't figure it out.

    so the texts:
    // set in cell.textLabel.text = @"<...>";
    This is a longer text message
    short text
    turns into:
    This is a longer text messa..
    short t...
    If I change the style of the cell to UITableViewCellStyleDefault the text isn't being trimmed.
    Only some tables are affected but I have been checking around and I can't seem to find what the problem is...
  2. dantastic thread starter macrumors 6502a


    Jan 21, 2011
    ok, I've to learn to sanitize my inputs a bit better.
    turned out that the string I was feeding the textLabel has a newLine character i it. stripping the new-lines and the cells look right.

Share This Page