iosobjective-cuilabelnsparagraphstyle

bug with LineBreakMode


Can you explain me why NSLineBreakByWordWrapping sometimes not working?

It's tableView

NSMutableParagraphStyle *paragrahStyle = [[NSMutableParagraphStyle alloc] init];
[paragrahStyle setLineSpacing:4];
paragrahStyle.lineBreakMode = NSLineBreakByWordWrapping; //Char

[[cell titleLabel] setAttributedText:[[NSAttributedString alloc] initWithString:((Post *)posts[indexPath.section])->title attributes:@{NSParagraphStyleAttributeName : paragrahStyle, NSFontAttributeName : [UIFont fontWithName:@"Roboto-Condensed" size:24.0f]}]];

enter image description here


Solution

  • YES! ;)

    I get this line in format:

    \U041f\U0438\U0440\U043e\U0436\U043d\U044b\U0435\U00a0Laduree\U00a0\U00ab\U043e\U0434\U0435\U0442\U044b\U0435\U00bb \U0432\U00a0Emilio Pucci

    where \U00a0 is wrong spaces (NO-BREAK SPACE), i encode this line and replace wrong spaces to normal spaces