0

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?

Patrick Lyon
  • 3
  • 1
  • 3

1 Answers1

1

\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...";
Filip Radelic
  • 26,607
  • 8
  • 71
  • 97
  • 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
\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"; – Patrick Lyon Apr 15 '12 at 13:31
  • You can't have actual new lines in your text (I can see them when I copy/paste the code from your comment), you need to replace them all with `\n` like this: `textView.text = @"The 5th Generation in the Z family.\nEngine Specs:\nVQ37CHR - 3.7 Liter DOHC\n 24-Valve V6\n332hp @ 7,000rpmn276 lb-ft @ 5,200rpm\nNismo Tuned Dual Exhaust\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...";` – Filip Radelic Apr 15 '12 at 13:49
  • And that Goes into the Code? not into the text view. Thank you for helping me. its always the simple things lol. – Patrick Lyon Apr 15 '12 at 13:58