Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

danmwall

macrumors newbie
Original poster
I have a label that is set to wrap to multiple lines. I am setting the text in the code using setText, but it is rather long and I would like to break it up to make it easier to read. Is there a way to insert a carriage return/line feed? For example:

[sampleText setText😡"This text is pretty long. I would like a CRLF here. See, isn't this easier to read now?"];

Seems like it should be simple enough...
 
I have a label that is set to wrap to multiple lines. I am setting the text in the code using setText, but it is rather long and I would like to break it up to make it easier to read. Is there a way to insert a carriage return/line feed? For example:

[sampleText setText😡"This text is pretty long. I would like a CRLF here. See, isn't this easier to read now?"];

Seems like it should be simple enough...
set the number of lines to be shown in label attribute, and then use \n as line breaker.
 
[sampleText setText😡"This text is pretty long. I would like a CRLF here. See, isn't this easier to read now?"];

Being nit-picky here but, simply for information's sake, using CRLF (\r\n) as a line/section break is limited mostly to ASCII-based comm protocols and Windows. The POSIX world (Mac OS X, Linux, *BSD, etc.) all use just an LF (\n) while Classic Mac OS used CR (\r).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.