Wrapping up Objective-C (iOS 4)

Table 2.2 summarizes the syntax specifics of the Objective-C elements that we’ve been discussing. This table can serve as a quick reference whenever you want to revisit how Objective-C code works differently from traditional C.

Table 2.2 Objective-C uses many typical object-oriented coding elements, but its syntax is somewhat unique.

Object-oriented element

Syntax

Object messaging

tmp12-43

Class creation

tmp12-44

Method declaration


tmp12-45

Property declaration

tmp12-46

Property synthesis

tmp12-47

Property accessor

tmp12-48

Property mutator

tmp12-49

Property dot syntax

tmp12-50

Category declaration

tmp12-51

Protocol declaration

tmp12-52

And with that, we’ve completed our look at the syntax and structure of the Objective-C programming language. But that’s only half of the foundation you need in order to use the SDK. You also need to be familiar with the specific methods and programming styles provided by iOS’s extensive set of frameworks.

Summary

Objective-C is your programming language for creating iOS applications. It’s an object-oriented version of C that has some unique syntax thanks to its elegant Smalltalk inspiration. After you get used to it, you’ll find it simple and easy to read.

Now that we’ve completed our Objective-C primer, let’s dive into putting Objective-C to use in Xcode 4 in topic 3.

Next post:

Previous post: