Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
September 20, 2018, 12:32:09 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: format specifiers for NSLog  (Read 1716 times)
todrico
Newbie
*
Posts: 17


Email
« on: February 20, 2013, 01:13:07 PM »

I have several years experience in C.  Now I feel I need to progress to OOP and try my hand at creating apps.  I really like your book.  You explain objects, classes, etc. very clearly. That helps an old dog like me to learn a new trick.  One thing I cannot find in your book is a list of format specifiers similar to those used for "printf" in C - %c, %i, %e, %f, %s, etc. If there is a list in your book please direct me to that page.  So far the only format specifiers I have seen are %i and %@.
Logged
todrico
Newbie
*
Posts: 17


Email
« Reply #1 on: February 20, 2013, 03:35:02 PM »

I found a data listing on pages 54 - 55, 4th Ed, which covers several NSLog data type formats. It would be nice to have a table which would list all data format types for NSLog including %@. Maybe next edition.  Undecided
Logged
afterDark
Global Moderator
Full Member
*****
Posts: 131


« Reply #2 on: February 20, 2013, 04:07:13 PM »

As I progressed through the book, I found it is not really designed as a reference book. Not filled with complete tables with things like format specifiers nicely laid out, for later reference. I am not the writer either, so I cannot talk for Steven Kochan, but I guess since XCode and Objective-C are a moving target, it is maybe even not feasible to keep up with everything.

Although something like format specifiers is probably not going to change much.

Anyway. It is a very good idea to learn your way in the documentation provided by Apple. It is generally well written and has tons of info. In case you haven't tried it: Within XCode, choose Window - Organizer - Documentation. In the left panel you can search after clicking on the magnifying glass (for instance for format specifier, I found some nice lists there). Anything that you feel you need to go back to later, (format specifiers is a good candidate for that) can be bookmarked by choosing Editor - Add Bookmark.
All your documentation bookmarks are visible by changing from magnifying glass to open book above the left panel.

It is maybe a confusing explanation in words without being able to show it. I hope it helps!
Logged

I am just an amateur with Objective-C, don't let the moderator label fool you. Working my way through the book slowly.
todrico
Newbie
*
Posts: 17


Email
« Reply #3 on: February 21, 2013, 01:54:02 PM »

Thanks for the tip.  I will definitely try it.  My frustration was with the book's index. Since the % was related to format data using NSLog in chapter 3, the index only had one example listed on page 24 using %i. But a larger list of % characters used by NSLog are listed on page 55 under "Basic Data Types" which was not listed in the index under NSLog.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents ゥ 2009 classroomM.com. All rights reserved.