Line breaks XCode - do not truncate the label

advertisements

I have a label in Xcode, and when the text is long, I don't want it to truncate, but I want the remaining text to go into a new line. I made room for 3 lines, but again, it's only truncating. How can I solve this?

Thanks.


yourLabel.lineBreakMode=UILineBreakModeWordWrap;
yourLabel.numberOfLines=0;

note: it is deprecated in ios6, then use:

NSLineBreakByWordWrapping