Escape Sequences

NSLog, and its corresponding C function printf(), use escape sequences to print certain characters that are “invisible.” For iOS, include:

Sequence Meaning
\b Backspace
\f Form Feed
\n Newline
\t Horizontal Tab
\v Vertical Tab
\\ Backslash
\’ Single Quote
\” Double Quote
\? Question Mark

There are others, such as \a for Alert, but they are rarely used, and don’t make an effect.

Leave a comment


  1. Splanu

     /  August 3, 2012

    Im sure most people wont need this information, but it took me a while to make the connection to NSLog and the console log. Use these commands to format the text in the console log when you are sending information there.

  1. Learn Objective-C in 24 Days « Programming for iOS
  2. Extension 3: ASCII, Booleans, Characters « Programming for iOS

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

  • Welcome

    My goal is to make CupsOfCocoa into a beautiful source for beginners to the iPhone platform to get started. Subscribe below for more, and stay tuned!

  • Contact Me

    If you need to contact me for any reason, feel free to send me an email.
  • The Giving Spirit

    If you've found this site helpful, would you consider donating a little sum? Any amount is appreciated...Thanks so much!

  • Roadmap

  • Enter your email address to follow this blog and receive notifications of new posts by email.

    Join 220 other followers

  • Back to the Past

    September 2010
    S M T W T F S
  • Time Machine

  • You count!

  • Worldwide Stats

    free counters
%d bloggers like this: