Why do new lines not appear in my text label?

Joined
Feb 13, 2012
Messages
2
Reaction score
0
Points
1
I wrote this code in my "viewDidLoad" function in my iOS project.

Code:
lettersLeftLabel.text = @"ABCDEFGH\nIJKLMNOP\nQRSTUVWX\nYZ";

"lettersLeftLabel" is an IBOutlet denoting a text label.

However, no newlines appear. Why?
 
Joined
Aug 13, 2011
Messages
200
Reaction score
7
Points
18
Location
West Sussex
A UILabel does not support multiline text, but the NSTextField used in Mac OSX projects does.

So you will have to use a UITextView object in your iOS projects, for multiline text, and if you set it's
editable property to false in the attributes inspector, then it will serve the same purpose as an UILabel.

Hope this helps.

Regards Mark
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top