Wordwrapping NSArray Objects???

Discussion in 'iOS Development' started by Duykur, Jun 16, 2009.

  1. Duykur

    Duykur Banned

    Joined:
    Mar 24, 2008
    Messages:
    1,674
    Likes Received:
    0
    This is giving me a headache, I posted this on the Apple Dev. Forums but have gotten no help. I have a randomized text display "Thing", and i can get it to display, yet if the text is too long, it cuts off with a "..."

    This is my code:
    Code:
    self.myArray= [NSArray arrayWithObjects: 
    @"Test A Test A Test A Test A Test A Test A Test A Test A Test A Test A Test A ",
    @"Test B Test B Test B Test B Test B Test B Test B Test B Test B Test B Test B ",
    @"Test C Test C Test C Test C Test C Test C", nil]; 
    This displays as
    Code:
    Test C Test C Test C Test C Test C Te....
    Is there a way I can get this to wordwrap?
  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    If you're using a UILabel, simply set the linebreakmode to wordwrap and set the number of lines to what you require. If you are drawing the text manually, simply draw the text where you want it. If you are using a textview or webview, then you shouldn't be having any problems.

Share This Page