Chapter 2Introduction to Objective-C

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • An overview of Objective-C
  • Declaring classes and instancing objects
  • Memory management in Objective-C
  • The Model-View-Controller design pattern
  • Delegates and protocols in Objective-C
  • Overview of blocks
  • Error handling patterns in Objective-C

The first step to creating the Bands app is to learn about the language it will be written in, Objective-C. Objective-C is the programming language used to develop both Mac and iOS applications. It’s a compiled language, meaning that it gets compiled down to raw machine code as opposed to being interpreted at runtime. As its name implies, it’s based on the C programming language. It’s actually a superset of C that adds object-oriented programming methodologies. Because it’s a descendant of C, its syntax and concepts are similar to other C-based languages. In this chapter you learn the basics of Objective-C by comparing it to Java and C#.

EXPLORING THE HISTORY OF OBJECTIVE-C

Objective-C was developed in the early 1980s by a company called Stepstone. It was working on a legacy system built using C but wanted to add reusability to the code base by using objects and messaging. The concept of object-oriented programming (OOP) had been around for a while. The Smalltalk language developed by Xerox was the most prominent object-oriented language in use at the time. Objective-C got its start by taking some of the concepts and syntax of Smalltalk and adding it to C. This can ...

Get Beginning iOS Programming: Building and Deploying iOS Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.