Synopses & Reviews
Learning Cocoa with Objective-C is the "must-have" book for people who want to develop applications for Mac OS X, and is the only book approved and reviewed by Apple engineers. Based on the Jaguar release of Mac OS X 10.2, this edition of Learning Cocoa includes examples that use the Address Book and Universal Access APIs. Also included is a handy quick reference card, charting Cocoa's Foundation and AppKit frameworks, along with an Appendix that includes a listing of resources essential to any Cocoa developer--beginning or advanced.Completely revised and updated, this 2nd edition begins with some simple examples to familiarize you with the basic elements of Cocoa programming as well Apple's Developer Tools, including Project Builder and Interface Builder.After introducing you to Project Builder and Interface Builder, it brings you quickly up to speed on the concepts of object-oriented programming with Objective-C, the language of choice for building Cocoa applications. From there, each chapter presents a different sample program for you to build, with easy to follow, step-by-step instructions to teach you the fundamentals of Cocoa programming. The techniques you will learn in each chapter lay the foundation for more advanced techniques and concepts presented in later chapters.You'll learn how to:
- Effectively use Apple's suite of Developer Tools, including Project Builder and Interface Builder
- Build single- and multiple-window document-based applications
- Manipulate text data using Cocoa's text handling capabilities
- Draw with Cocoa
- Add scripting functionality to your applications
- Localize your application for multiple language support
- Polish off your application by adding an icon for use in the Dock, provide Help, and package your program for distribution
Each chapter ends with a series of Examples, challenging you to test your newly-learned skills by tweaking the application you've just built, or to go back to an earlier example and add to it some new functionality. Solutions are provided in the Appendix, but you're encouraged to learn by trying.Extensive programming experience is not required to complete the examples in the book, though experience with the C programming language will be helpful. If you are familiar with an object-oriented programming language such as Java or Smalltalk, you will rapidly come up to speed with the Objective-C language. Otherwise, basic object-oriented and language concepts are covered where needed.
Based on the Jaguar release of Mac OS X 10.2, this new edition of "Learning Cocoa covers the latest updates to the Cocoa frameworks, including examples that use the Address Book and Universal Access APIs. Also included with this edition is a handy quick reference card, charting Cocoa's Foundation and AppKit frameworks, along with an Appendix that includes a listing of resources essential to any Cocoa developer--beginning or advanced. After introducing you to Project Builder and Interface Builder, "Learning Cocoa with Objective-C brings you quickly up to speed on the concepts of object-oriented programming with Objective-C, the language of choice for building Cocoa applications. From there, each chapter presents a different sample program for you to build, with easy to follow, step-by-step instructions to teach you the fundamentals of Cocoa programming. The techniques you will learn in each chapter lay the foundation for more advanced techniques and concepts presented in later chapters.
"Learning Cocoa" is written specifically for C and C++ developers who are interested in learning to program for Mac OS X using Cocoa's objective-C framework. This edition presents a structured approach to learning the concepts through examples, along with additional tutorial and reference material.
A valuable book for developers who want to get in on the Mac OS X revolution, this new edition has been reworked from the ground up. Expanded with new tutorials, a more structured approach to learning the concepts and new reference material is included.
About the Author
This book was contributed to by the technical writers, engineers, support specialists, and other professionals at Apple Computer, Inc., who are committed to making Mac OS X a superior platform for innovation, productivity, and enjoyment. These professionals have diligently collected, compiled, and edited the information in this books to ensure that it is a useful resource for Mac OS X developers.
James Duncan Davidson is a freelance author, software developer, and consultant focusing on Mac OS X, Java, XML, and open source technologies. He is the author of Learning Cocoa with Objective-C (published by O'Reilly & Associates) and is a frequent contributor to the O'Reilly Network online website as well as publisher of his own website, x180 (http://www.x180.net), where he keeps his popular weblog. Duncan was the creator of Apache Tomcat and Apache Ant and was instrumental in their donation to the Apache Software Foundation by Sun Microsystems . While working at Sun, he authored two versions of the Java Servlet API specification as well as the Java API for XML Processing. Duncan regularly presents at conferences all over the world on topics ranging from open source and collaborative development to programming Java more effectively. He didn't graduate with a Computer Science degree, but sees that as a benefit in helping explain how software works. His educational background is in Architecture (the bricks and mortar kind), the essence of which he applies to every software problem that finds him. He currently resides in San Francisco, California.
Table of Contents
Preface; Audience; About the Example Code; How This Book Is Organized; How to Use This Book; Conventions Used in This Book; How to Contact Us; Acknowledgments; Cocoa Overview and Foundation; Chapter 1: Introduction to Cocoa; 1.1 The Mac OS X Programming Environment; 1.2 Cocoa Defined; 1.3 The Cocoa Frameworks; 1.4 Languages; 1.5 The Foundation Framework; 1.6 The Application Kit Framework; Chapter 2: Cocoa Development Tools; 2.1 Installing the Developer Tools; 2.2 Interface Builder; 2.3 Other Tools; 2.4 Exercises; Chapter 3: Object-Oriented Programming with Objective-C; 3.1 Introducing Objects; 3.2 Creating and Using Objects; 3.3 Methods and Messages; 3.4 Objective-C-Defined Types; 3.5 Creating New Classes; 3.6 Overriding Methods; 3.7 Other Concepts; 3.8 Exercises; Chapter 4: The Cocoa Foundation Kit; 4.1 Strings; 4.2 Collections; 4.3 Memory Management; 4.4 Exercises; Single-Window Applications; Chapter 5: Graphical User Interfaces; 5.1 Graphical User Interfaces in Cocoa; 5.2 Designing Applications Using MVC; 5.3 Create the Currency Converter Project; 5.4 Create the Interface; 5.5 Define the Classes; 5.6 Connect the Model, Controller, and View; 5.7 Implement the Classes; 5.8 Build and Run; 5.9 Exercises; Chapter 6: Windows, Views, and Controls; 6.1 Windows and the Window System; 6.2 The View Hierarchy; 6.3 Coordinate Systems; 6.4 Controls, Cells, and Formatters; 6.5 Targets and Actions; 6.6 Exercises; Chapter 7: Custom Views; 7.1 Custom View Creation Steps; 7.2 Create a Custom View; 7.3 Drawing into a View: Behind the Scenes; 7.4 Draw Strings into a View; 7.5 Draw Paths into a View; 7.6 Exercises; Chapter 8: Event Handling; 8.1 Events; 8.2 Dot View Application; 8.3 Event Delegation; 8.4 Notifications; 8.5 Exercises; Chapter 9: Models and Data Functionality; 9.1 Protocols; 9.2 Key-Value Coding; 9.3 Table Views; 9.4 Table View Example; 9.5 Saving Data: Coding and Archiving; 9.6 Using Formatters; 9.7 Sorting Tables; 9.8 Exercises; Document-Based Applications; Chapter 10: Multiple Document Architecture; 10.1 Architectural Overview; 10.2 Building a Document-Based Application; 10.3 Exercises; Chapter 11: Rich-Text Handling; 11.1 Cocoa's Text System; 11.2 Creating a Rich-Text Editor; 11.3 Enabling the Font Menu; 11.4 Text Storage and Attributed Text; 11.5 Enabling the Text Menu; 11.6 Handling Embedded Images; 11.7 Exercises; Miscellaneous Topics; Chapter 12: Printing; 12.1 Printing a View; 12.2 Using Print Operations; 12.3 Setting Margins; 12.4 Exercises; Chapter 13: Bundles and Resources; 13.1 Peeking Inside Bundles; 13.2 Using Bundles; 13.3 Exercises; Chapter 14: Localization; 14.1 Mac OS X Language Preferences; 14.2 Localizing Resources; 14.3 Localizing Nib Files; 14.4 Localizing Strings; 14.5 Exercises; Chapter 15: Defaults and Preferences; 15.1 How Preferences Work; 15.2 Using Defaults; 15.3 Command-Line Preferences Access; 15.4 Using Unique Application Identifiers; 15.5 Exercises; Chapter 16: Accessory Windows; 16.1 The Role of File's Owner; 16.2 Making an Info Window; 16.3 Exercises; Chapter 17: Finishing Touches; 17.1 Tidying Up the User Interface; 17.2 Providing an Icon; 17.3 Providing Help; 17.4 Customizing the About Box; 17.5 Tweaking Compiler Settings; 17.6 Packaging for Distribution; 17.7 Closure; 17.8 Exercises; Appendixes; Exercise Solutions; Chapter 2; Chapter 3; Chapter 4; Chapter 5; Chapter 6; Chapter 7; Chapter 8; Chapter 9; Chapter 10; Chapter 11; Chapter 12; Chapter 13; Chapter 14; Chapter 15; Chapter 16; Chapter 17; Additional Resources; Documentation on Your Hard Drive; Printed Documentation; Getting Sample Code; Web Sites; Mailing Lists; Partnering with Apple; Using the Foundation and Application Kit API References; Cocoa Browser; Colophon;