Objective-C Primer
The iPhone API uses the Objective-C language. Objective-C is an application of principles from Smalltalk to the C language. The idea was to combine the power of the C language, which is an industry standard, with the object-oriented programming approach of the Smalltalk language. The result is a language that might be confusing at first, but it makes sense once you understand a few concepts.

Figure 1-22. Editing the App ID in Info.plist

Figure 1-23. Setting the device as the build target
The first thing to know is that Objective-C is a strict superset of C. Anything that you can write in C you can compile using the Objective-C compiler. C-style structs, function calls, memory allocation, and pointers are all available. However, in addition to all of the normal C language syntax, Objective-C adds some of its own features as well, such as thread synchronization, try-catch blocks, and garbage collection. The primary improvement provided (and the reason for the language) is an object-oriented structure.
Classes
Classes in Objective-C are conceptually very similar to Java and C++ classes. A class is an object that contains data, called member variables, and functions, called methods. Just like in Java and C++, classes are usually defined before they can be used (although in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access