Search code examples
xcodemacosxcode4xcode4.2xcode4.3

How To Create a paragraph in Text View?


Does anyone know how to create a Paragraph in text view. I'm trying to learn Xcode and by trying to learn I'm making an app. I Want it to look like: (When i type it in it looks like this but it won't come out like this.

"

Engine Specs:

VQ37CHR - 3.7 Liter DOHC 24-Valve V6

332hp @ 7,000rpm

276 lb-ft @ 5,200rpm

Nismo Tuned Dual Exhaust

Twin intake System



Drivetrain:


Carbon Fiber Drive Shaft

6-speed close-ratio Manual Transmission

7-speed Automatic w/ manual shift mode, paddle shifters and rev matching

VLSD


4-wheel vented disc brakes

2-link Double wish bone Suspension front

4-link Suspension rear

front and rear Stabilizer bars"

But it keeps coming out Like one giant paragraphs like This:

"The 5th Generation in the Z family.

Engine Specs:
VQ37CHR - 3.7 Liter DOHC 24-Valve V6
332hp @ 7,000rpm
276 lb-ft @ 5,200rpm
Nismo Tuned Dual Exhaust
Twin intake System

Drivetrain:

Carbon Fiber Drive Shaft
6-speed close-ratio Manual Transmission
7-speed Automatic w/ manual shift mode, paddle shifters and rev matching
VLSD

4-wheel vented disc brakes
2-link Double wish bone Suspension front
4-link Suspension rear
front and rear Stabilizer bars"

I'm a noob at this sorry.

Upadted textView.text = @"The 5th Generation in the Z family.\nEngine Specs:\nVQ37CHR - 3.7 Liter DOHC\n 24-Valve V6\n332hp @ 7,000rpm\n276 lb-ft @ 5,200rpm\nNismo Tuned Dual Exhaust\n\nTwin intake System\n\nDrivetrain:\nCarbon Fiber Drive Shaft\n6-speed close-ratio Manual Transmission\n7-speed Automatic w/ manual shift mode, paddle shifters and rev matching\nVLSD\n\n4-wheel vented disc brakes\n2-link Double wish bone Suspension front\n4-link Suspension rear\nfront and rear Stabilizer bars";<-- I'm putting this into the view FirstViewController.m is this the right place to put it?


Solution

  • \n aka newline character. Put it in your text where you want new lines to be, like this:

    textView.text = @"Engine Specs:\nVQ37CHR - 3.7 Liter DOHC 24-Valve V6\n...";