Chapter 6. The Basics of Objective-C

In This Chapter

  • Using object-oriented programming

  • Knowing the differences among classes, variables, and methods

  • Understanding and coding in Objective-C

  • Using your own classes

Objective-C is the language that most developers use to program Cocoa applications. Although it's not the only language that you can use for Cocoa development, it's by far the most popular. Objective-C is a superset of the popular C programming language that bears an uncanny resemblance to SmallTalk (which is no accident). If you're an experienced C programmer already, you'll find that Objective-C makes you feel like you're in familiar surroundings, with a few language oddities thrown in. If you aren't well versed in C but know another programming language, you can probably figure out what's going on anyway.

This chapter examines the basics of object-oriented programming and the Objective-C language. After you get the hang of how Objective-C works, the chapter helps solidify your skills by building a project and using Objective-C. In the process, you find out how to create objects in code. Next, the chapter runs you through another important topic in Objective-C: class methods. The chapter concludes with a look at the way you should name things in Objective-C. Naming schemes plays an important role in Objective-C. As you can see, this chapter is a collection of several small facts. These bits of knowledge form a larger body of information that you'll use every time you program ...

Get Cocoa® Programming for Mac OS® X For Dummies® 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.