Advertisements

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.

Advertisements
Leave a comment

3 Comments

  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.

    Reply
  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:

WordPress.com Logo

You are commenting using your WordPress.com 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

Advertisements
  • 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 222 other followers

  • Back to the Past

    September 2010
    S M T W T F S
    « Aug   Oct »
     1234
    567891011
    12131415161718
    19202122232425
    2627282930  
  • Time Machine

  • You count!

    • 621,662 views
  • Worldwide Stats

    free counters
  • Advertisements
%d bloggers like this: