Results 1 to 2 of 2
  1. #1

    Member Since
    Feb 13, 2012
    Unhappy Why do new lines not appear in my text label?
    I wrote this code in my "viewDidLoad" function in my iOS project.

    lettersLeftLabel.text = @"ABCDEFGH\nIJKLMNOP\nQRSTUVWX\nYZ";
    "lettersLeftLabel" is an IBOutlet denoting a text label.

    However, no newlines appear. Why?

  2. #2

    Mark FX's Avatar
    Member Since
    Aug 13, 2011
    West Sussex, UK
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Deleting Lines of Text in Terminal
    By javinladish in forum macOS - Operating System
    Replies: 2
    Last Post: 10-19-2011, 08:50 PM
  2. search for lines of text in a huge file
    By jakeroberts in forum macOS - Apps and Games
    Replies: 14
    Last Post: 06-10-2007, 10:21 AM
  3. Text editor with hide lines
    By drde in forum macOS - Apps and Games
    Replies: 1
    Last Post: 10-24-2006, 04:38 AM
  4. center text on a label
    By Kenai@work in forum Switcher Hangout
    Replies: 4
    Last Post: 10-04-2005, 09:03 PM
  5. Desktop Icon Label Text Background
    By heywire in forum Running Windows (or anything else) on your Mac
    Replies: 1
    Last Post: 12-07-2003, 01:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts