Beginning iOS Development

Course No. 10-152-143

Modern Objective-C

Whenever an assignment or exam specifies that you need to use Modern Objective-C this is what it means.

  • Don’t Use Instance Variables
  • Don’t use the @synthesize directive unless it is required.
  • Use the new literal syntax whenever possible for these:
  • Use class extensions when declaring properties that don’t need to be public.
  • Use of dot notation for accessing properties is acceptable and encouraged. However, it can only be used for properties, not methods that are not accessor methods.
    • To call a property’s set method:
      • self.firstName = @"Fred";
      • self.maximumCount = 100;
    • To access a property’s value:
      • NSLog(@"First Name: %@", self.firstName);
      • for (int index = 0; index < self.maximumCount; index++) {