Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Mikaila Akeredolu
10,654 PointsHow can I code a line break <br> into a plist ?
This is my first paragraph for text.
This is my second paragraph of text.
(The above is visually how the text/strings appears in my IOS simulator when ran)
As you can see the sentences do not line up. There is a space before the second sentence starts. How can I code my plist so that both sentences line up and align properly like the sentences below.
This is my first paragraph for text.
This is my second paragraph of text.
10 Answers
Faye Bridge
4,879 PointsHi Mikaila!
Do you mind sharing your code with us? That way we'll be able to take a look at it and see where the issue is. :)
You can link us to a screenshot using the Markdown commands found under Markdown Cheatsheet below or email us at help@teamtreehouse.com if you need help.
Amit Bijlani
Treehouse Guest TeacherTry using a \n so your text would essentially be like:
This is my first paragraph for text.\nThis is my second paragraph of text.
Mikaila Akeredolu
10,654 PointsThanks guys. I added the \n but it did not make the second sentence align with the first but it started the second sentence on another line.
Mikaila Akeredolu
10,654 Pointsamit are you suggesting that I add that \n into my sentences within the plist?
Will give it a shot. Thanks.
Amit Bijlani
Treehouse Guest TeacherMake sure you don't have spaces between the first and second line. They should be separated only by a \n "This is my first paragraph for text.\nThis is my second paragraph of text."
Mikaila Akeredolu
10,654 PointsThanks Boss. Will do. Truly appreciate the help.
Mikaila Akeredolu
10,654 Points@Amit. putting \n in my plist file did not work. @Faye. I will be sending screenshots of my code to the email address provided. I'm not familiar with this Markdown thing. Thanks.
Christina Cherry
1,110 PointsI found \n created a new line and \n\r did a paragraph in the text view, not sure how it will work in plist. Is there any way in iOs we can format text for more advanced features such as the div or table tags in html?
Amit Bijlani
Treehouse Guest Teacher@Christina You can embed a Web View and have all kinds of HTML formatting. See: http://teamtreehouse.com/library/ios-5-foundations/web-view
Christina Cherry
1,110 PointsThanks Amit - Actually I already have that in part of an app but trying to load html into NSArray so I can have custom pages