iPhone label with two lines string

Posted on 2011-10-16
Last Modified: 2012-05-12
Dear Expert:

I have an iPhone application. I have a label on a view.
I'm asigning a string to this view by code, and this string is extracted from a plist file and has entered by pressing Ctrl+RETURN (to put the two lines).

When running application both lines are concatenated on the same line, so it seems label doesn't recognizes the carry return. What I'm doing wrong ?
Question by:gplana
    LVL 13

    Assisted Solution

    Try setting the number of lines on the label.

    [label setNumberOfLines:2];

    Open in new window

    LVL 15

    Accepted Solution

    I had already this property to 2 (on design).

    I have solved the problem for my own. I'ts just to remove the Ctrl+Return and add the line break by typing Alt+Return. I don't understand why but it works.
    LVL 15

    Author Closing Comment

    I have found the solution for my own.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    When Apple released Swift last year, the aim was to introduce a new programming language for Cocoa and Cocoa Touch that was fast, easy and effective, like the name connotes. Apple succeeded. Swift is designed to couple with Objective-C program…
    The release of the iPhone 6 and the iPhone 6 Plus was extremely successful for Apple. However when iOS 8.1 was introduced, many iPhone users complained of quick battery drainage. Without even knowing, you may be unnecessarily using up your battery p…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now