1. comments
    1. use // for single line
    2. use /*- */ for multiple lines
      1. terminated
      2. can't nest
    3. enhance readability
    4. document program
    5. get into habit
      1. document while fresh in mind
      2. reap benefits of comments during debug phase
      3. helps when reading through program
      4. can help point to logic mistake
      5. will not like backtracking to enter comments
    6. Subtopic 6
      1. prog1
        1. // First program example
  2. #import
    1. import/include information from a system file
    2. prog1
      1. #import <Foundation/Foundation.h>
  3. int main
    1. program starts here
    2. main
      1. special name
      2. indicateswhere program begins
    3. int
      1. reserved word that precedes main
      2. value 'main' returns
    4. prog1
      1. int main (int argc, const char * argv[l
  4. Misc
    1. begin anywhere on the line
      1. make programs easier to read
      2. compiler doesn't care how many spaces exist
    2. Upper/case lower case are distinct
  5. [pool drain];
    1. releases allocated memory pool
    2. releases object associated with allocated memory pool
    3. Xcode automatically inserts this line into Prog1
  6. return 0;
    1. terminate execution of main
    2. send back or "return" status value of 0
    3. 0 means program ended normally
    4. nonzero value means problem
    5. Debug Console window
      1. The Debugger has exited with status 0
      2. status 0 means program worked
  7. Statements
    1. expression terminated with semicolon
    2. enclosed in curly braces
    3. part of the 'main' routine
    4. specifies what 'main' routine performs
    5. terminate all statements with semicolon - ;
    6. variables
      1. types
        1. Integer
          1. integral values
          2. values without decimal
          3. 3, 5, -20, 0
          4. int
        2. Floating-point
          1. decimals
          2. 2.4, 2.455, 27.0
          3. real numbers
      2. define
        1. define/(declare?) before using
          1. can declare anything to be a variable
        2. definition tells compiler how program should use variable
        3. compiler uses definition to generate instructions to store and retrieve values in/out of variable
    7. NSLog
      1. invoke/call routine NSLog
      2. routine
      3. function in ObjC library
      4. Displays/Logs argument(s)
        1. multiple arguments
          1. first argument ("Format String")is always character string to be displayed
          2. the next argument here is the variable, sum
          3. this NSLog routine will display the string and then variable value
          4. Percent character % is special character recognised by NSLog
          5. the "i" following % specifies type of value to be displayed
          6. with %i in character string, NSLog dusplays value of next argument
      5. Displays/Logs phrases
      6. Displays/Logs values of variables
      7. Displays/Logs results of computations
      8. Displays/Logs date/time routine executed (don't care about this)
    8. prog1
      1. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]
      2. NSLog (@"Programming is fun!");
        1. (@"Programming is fun!");
          1. string of characters
          2. pass/handle paramater/argument "Programming is fun !" to NSLog routine
          3. @ sign makes this "constant NSString object"
        2. adding lines of output
          1. adding another call to NSLog routine
      3. add picture for example
    9. "Newline" character
      1. two-character sequence
      2. \n
      3. \n tells system: go to a new line
      4. characters printed after "n" go to new line
      5. no spaces before/after
      6. newline character example
    10. character string
    11. arguments
  8. Ch.2 Exercise Questions
    1. Untitled 2.rtf
  9. Variables