Appendix. Appendix

 

The appendix covers

  • Introduction to Objective-C
  • Using blocks
  • Optimizing applications with Grand Central Dispatch
  • Understanding automatic reference counting

When you write applications, all you’re doing is providing a set of instructions for the computer to follow. These instructions are specifically crafted in a language that both the compiler and humans can understand. In iOS, the language you write in is Objective-C, and we used it extensively throughout the book. This appendix includes information about the language that will provide you with a better understanding of how iOS applications work.

A.1. Introduction to Objective-C

Objective-C is the primary language you use when writing iOS applications. It’s based on the C programming language with a couple of additions that make it a complete object-oriented language. We said “primary” because given that Objective-C is a superset of C, writing C code is perfectly valid. In fact, the compiler that Xcode uses (LLVM since Xcode 3.2.3, GCC on earlier versions) is a C compiler modified to understand all of Objective-C’s additions.

A.1.1. Class syntax

In a way, an application is an ecosystem of interconnected objects interacting with one another. In object-oriented programming (OOP) terms, an object is an instance of a class, and in Objective-C, classes are declared in two files:

A.2. Using blocks

A.3. Optimizing applications with Grand Central Dispatch

A.4. Understanding automatic reference counting

A.5. Summary