1. methods
    1. instance method
      1. the actions performed on the instance
        1. eg
          1. setting value
          2. retrieving value
          3. printing value
    2. class method
      1. applies to a class
        1. eg
          1. creating a new instance of a class
    3. applying method can affect state of object
    4. can apply same methods to different objects
      1. a key concept
    5. syntax
      1. ( ClassOrInstance method );
        1. 1st... left bracket
        2. 2nd... name of class or instance
        3. 3rd.... a space
        4. 4th... name of method
        5. 5th... closed off with right bracket
        6. 6th... semicolon to teminate
      2. ( receiver message );
        1. different way to think about syntax format
        2. ask to perform some action = sending "message" to class/instance
        3. recipient is "reciever"
          1. class or method
        4. method is the message
    6. example of applying a class method
      1. send message to Car class (reciever)
      2. asking to give new car
      3. resulting object is stored in variable yourCar
      4. class or factory method
    7. example of instance method (more to the right)
      1. actions on new car are instance methods (see below)
      2. [myCar wash];
      3. [myCar drive];
      4. [myCar service];
    8. minus sign (-) is instance method
    9. plus sign (+) is class method
  2. object
    1. thing
    2. something that I want to do to a thing
    3. instance of a class
    4. each instance is an object
    5. each object has unique characteristics
    6. instance variable
    7. has own set of instance variables
    8. is about dealing with things/objects
  3. class car
    1. object myCar
      1. method drive it
      2. method fill with gas
      3. method wash it
      4. method service it
  4. create new class and object (3.2)
    1. @interface section
      1. does 3 things
        1. describes class
        2. describes class data components
        3. describes class methods
        4. Summary
      2. to define a class - 3 things
        1. tell compiler what "parent" class new class came from
        2. specify data to be stored in objects of class
        3. define type of operations (methods) that can be used with objects
        4. Summary
      3. @interface section general format
      4. @interface example 3.2
        1. what is this section called????????????
          1. new class name Fraction
          2. parent class NSObject
          3. NSObject class defined in NSObject.h
          4. NSObject.h included when import Foundation.h
        2. memberDeclaration section
          1. members declared are "instance variables"
          2. specifies type of data stored in new class
          3. specifies names of data types
          4. closed in curly braces
          5. this example has two "integer members" called numerator and denominator
        3. Subtopic 4
          1. displays value of the declared members
          2. minus sign (-) means it's an instance method
          3. type (void) returns no value
        4. Subtopic 3
          1. two declared instance methods
          2. return no value
          3. n and d are integer arguments
          4. you "declare" methods in @implentation section
    2. @implementation section
      1. @implementation general format
      2. @implementation example 3.2
        1. NewClassName is same as in @interface
        2. contains the code that implements class methods
        3. contains code for methods declared in @interface section
        4. you "define" the methods (give actual code) in @implementation section
    3. program section
      1. contains program code
  5. forming variable names
    1. 1. begin with letter or underscore
    2. 2. follow with letters, underscores, digits
    3. "reserved words/name" not used
      1. Appendix B for list
    4. cannot start with number
    5. no spaces
    6. no invalid characters
    7. upper/lower case sensitive
    8. classes start with upper-case (by convention)
      1. "AddressBook"
    9. instance variables/objects start with lower-case
      1. "currentEntry" or "current_entry"
    10. methods start with lower-case
      1. "addNewEntry"
    11. upper-case inside names to start new word
      1. readability
    12. pick meaningful names
      1. increase readability
      2. good for debug/documentation phases
      3. program more self-explanatory
  6. accessing instance variables
    1. instance method w/variable example
      1. setNumerator method can access the numerator variable
      2. setDenominator method can access the denominator variable
    2. instance methods can access their own instance variables
      1. method calls
    3. Class methods can't access instance variables
      1. classes don't have instance variables
      2. class doesn't work with objects; they work with the class
      3. instance methods are only way to access instance variable
    4. "data encapsulation"
      1. instance variables are accessable inside the methods, but not accessible outside those methods
      2. keep data that is maintained for an object hidden from the outside world
      3. get access to data through method call