Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the syntax for new line in Objective-C?

Can anyone tell me what is the symbol used for new line?

In the C language we use '\n' for new line. What do we use in Objective-C?

is it same?

like image 441
Abhilash Avatar asked Jun 21 '11 04:06

Abhilash


People also ask

What is the syntax for next line?

In Windows, a new line is denoted using “\r\n”, sometimes called a Carriage Return and Line Feed, or CRLF. Adding a new line in Java is as simple as including “\n” , “\r”, or “\r\n” at the end of our string.

What does @() mean in Objective-C?

It's Shorthand writing. In Objective-C, any character , numeric or boolean literal prefixed with the '@' character will evaluate to a pointer to an NSNumber object (In this case), initialized with that value. C's type suffixes may be used to control the size of numeric literals.

How do I start a new line in Xcode?

Search for "line" under the Text tab. There are lots of "Insert Newline" commands for which you can set key combos. There's Ctrl+o, Cmd+Enter, Opt+Enter, etc.


1 Answers

Objective-C is an extension of C. So '\n' works too in Objective-C.

like image 160
gsempe Avatar answered Sep 20 '22 06:09

gsempe