Skip to Main Content
Objective-C® For Dummies®
book

Objective-C® For Dummies®

by Neal Goldstein
October 2009
Beginner content levelBeginner
456 pages
8h 59m
English
For Dummies
Content preview from Objective-C® For Dummies®

Chapter 7. Objects Objects Everywhere

In This Chapter

  • Turning numbers into objects

  • Working with mutable arrays

  • Using each object in an array in a message

  • Getting to know C arrays

Now that you know how to create classes and send messages to your objects, I want to expand your ideas about what you can do with objects. So far, what you have done is send messages from main to the objects you created. What you will soon find out is that your objects will be sending messages to other objects to assist them in carrying out their responsibilities as well. You'll also discover that you don't have to write all of the objects you need to use in your program. The frameworks I mentioned in Chapter 1 supply many of them for you. So you'll not only be creating your own objects, but also using the objects in Cocoa's Foundation classes that provide some of the "utility" functionality you need.

In this chapter, I'll introduce you to two of those objects. The first is NSNumber, one of the hundred or so classes in the Foundation Framework. All of the data types I explained in Chapter 4, signed or unsigned char, short int, int, long int, long long int, float, double, and BOOL, can be represented using the NSNumber class.

The second will be NSMutable arrays. Arrays are what you will use to manage lists of objects. While right now there are not that many objects to manage, as you develop your application, you'll begin to see how useful they can be. In this chapter, I'll show you how to take the NSNumber objects ...

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.
Start your free trial

You might also like

Objective-C

Objective-C

Jiva DeVoe
Cocoa in a Nutshell

Cocoa in a Nutshell

Michael Beam, James Duncan Davidson

Publisher Resources

ISBN: 9780470522752Purchase book