Skip to content

Morgan Davison

Dev Notebook

  • About
  • Contact
  • Apps
  • Privacy Policy

Tag: c

String formatting tokens

String formatting tokens reference sheet:

Token Data Type
s char (cstring)
d int
f float
.2f float rounded to 2 decimal places
p pointer
zu size_t
@ An object’s description

If you want to print a bool, you can do it like this:

NSLog(@"%@", BOOL_VAL ? @"YES" : @"NO");

 

Author mdavisonPosted on January 10, 2017August 2, 2017Categories resourcesTags c, objective-cLeave a comment on String formatting tokens

Recent Posts

  • Find your SQLite Database for Xcode 10
  • Rounded Corner Button in Swift
  • Free Simple Hex Color Picker
  • Laravel New Project Steps
  • Custom key bindings in Xcode 8

Recent Comments

  • Jin on Adding Soft Deletes to Existing Database Table in Laravel
  • mdavison on Prevent “Array index out of range” Error in Swift
  • Rowan on Embed Tab Bar Controller in Navigation Controller
  • Ali on Custom key bindings in Xcode 8
  • Ali on Custom key bindings in Xcode 8

Archives

  • October 2018
  • July 2018
  • February 2018
  • August 2017
  • July 2017
  • June 2017
  • February 2017
  • January 2017
  • October 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • November 2015
  • October 2015
  • September 2015
  • July 2015
  • June 2015
  • May 2015

Categories

  • hints
  • resources
  • snippets
  • tutorials

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
Privacy & Cookies: This site uses cookies.
To find out more, as well as how to remove or block these, see here: Our Cookie Policy
  • About
  • Contact
  • Apps
  • Privacy Policy
Morgan Davison GitHub Twitter

Hosted by DigitalOcean
Get $10 credit if you sign up through this link.