Online Book Reader

Home Category

Learn Objective-C on the Mac - Mark Dalrymple [3]

By Root 915 0
has given great feedback on nearly every chapter of the book, helping locate sections that needed further clarification. Joar Wingfors provided detailed commentary on several chapters, as well as a handy bit of public domain code that we used in Chapter 11. Tim Burks provided some important feedback on the final chapter. I owe a huge debt of gratitude to Tom Geller, who put me in touch with Apress in the first place; without Tom putting two and two together, I’d still be sitting here wondering if I’d ever write anything “real”. Finally, I’d like to thank my wife Weronica Meijer and our children, Henrietta and Dorotea, who’ve put up with my many long nights and “lost weekends” as I worked on this book, and have been more patient than I could have hoped for; this book is dedicated to them.

Preface

I first encountered Cocoa as a college student in about 1989. Of course, that was before the iPhone, before Mac OS X, and before it was even called Cocoa. Back then, the seed of today’s Cocoa was a part of NeXTStep, the OS that was the core of the NeXT computers. NeXTStep was years ahead of its time, and, while the lab full of NeXT workstations was woefully underused in the computer science courses, my student sysadmin job had me using them daily. As a user, I was hooked. I won’t dwell on the NeXT user experience here, but just state that many of the best features of Mac OS X come not so much from the Mac of old as from NeXTStep.

At that time, there was no www, not much of a NeXTStep developer community, and very little written about the development environment apart from the impenetrable tomes that NeXT shipped with its earliest machines. I tried to wrap my head around Objective-C and the AppKit from time to time, but without any nearby experts, or much example code to look at (not to mention my actual studies which sometimes distracted me from playing with fun projects), I was basically stumped.

After college, something completely unexpected happened. A friend pointed me in the direction of a consulting firm in my city that was building custom NeXTStep apps for some pretty big customers, and I had the good fortune to come on-board. Suddenly, I had a group of colleagues who had not only been programming in NeXTStep for a while, some of them had even worked at NeXT! All it took was a bit of their expert help to get me started, and the things that had seemed so mysterious for years suddenly made sense. Within a few weeks, I learned so much I was able to start leading some training and mentoring efforts in NeXTStep development.

The point of that isn’t that I’m a genius or a quick study. It’s that the set of technologies we now call Cocoa are really powerful, and quite easy to learn and put to good use; but you’re likely to need some help along the way. I’m hoping that this book will help nudge you in the right directions, and help you learn the essence of Cocoa programming, so that, by the time you’re finished reading it, you’ll have enough knowledge of Cocoa to be able to propel yourself forward and write the Mac applications of your dreams. In short, the kind of book I wish I’d been able to find 20 years ago.

Jack Nutting

Chapter 1

Must Love Cocoa

Welcome! You must be here because you want to write programs for your Mac. Well, you’ve definitely come to the right place. (Here for Pilates? Third door down, on the right.) By the time you finish this book, you’ll know everything you need to know to create fast, efficient, good-looking Mac OS X applications.

The key to creating a modern Mac application is Cocoa. According to Apple, Cocoa is a set of object-oriented frameworks that provide a runtime environment for Mac OS X applications. As you make your way through this book, you’ll learn all about the Cocoa frameworks and runtime environment. For the moment, think of Cocoa as a programmer’s assistant that takes care of much of the housekeeping that goes along with Mac development. Almost every common task performed by a Mac application, from drawing a window to blinking the cursor in a text field, is handled

Return Main Page Previous Page Next Page

®Online Book Reader