Chapter 3. An introduction to objects
This chapter covers
In Objective-C the use of object-oriented programming is optional. Because Objective-C is based on a C foundation, it’s possible to use C-style functions (as evidenced by calls to NSLog in the previous chapter), but Objective-C’s full power is unlocked only if you make full use of its object-oriented extensions.
In this chapter we reveal some of the benefits of object-oriented development by covering how the NSString class, provided by Foundation Kit, can improve your productivity while increasing the robustness of any code that interacts with text.
Before we go too far in depth on that particular topic, let’s first take a look at the most basic concepts of object-oriented programming.
In this chapter we can’t do justice to every concept associated with object-oriented programming (also termed OOP, for short). Instead, the goal of this chapter is to make sure you have a solid understanding of the fundamental concepts and benefits of object-oriented programming and a working knowledge of the terminology. Throughout this book, we discuss object-oriented programming concepts as they apply to Objective-C and expand on what’s covered in this chapter. Let’s get started by learning what’s so wrong with C.