Cocoa® Programming for Mac® OS X
Aaron Hillegass

ISBN-10: 0201726831
ISBN-13: 9780201726831

Publisher: Addison-Wesley Professional
Copyright: 2002
Format: Paper; 416 pp
Status: Out of Print

Suggested retail price: $44.99
Buy from myPearsonStore

Apple's Cocoa framework and tools are indispensable to every developer who wants to take full advantage of Mac OS X's features and performance, and get applications to market rapidly. However, Cocoa has a steep learning curve, and the official documentation leaves much to be desired. Now, Cocoa insider Aaron Hillegass presents the first start-to-finish guide for serious Cocoa development.KEY TOPICS:In this book, Hillegass leverages his experience as the creator of the world's first independent Cocoa training course, anticipating the questions that real-world developers ask about Cocoa -- and offering deep insight into the design patterns that give Cocoa its extraordinary power and elegance. He begins with an overview of Cocoa's goals, capabilities, and toolset. Learn how to use Cocoa's Project Builder to track all of your application's diverse resources, edit code, and compile and run applications. Master the Cocoa Interface Builder: leverage the full capabilities of Mac OS X's breakthrough Aqua interface, then go beyond "windows and widgets" to create classes and edit their attributes. Hillegass gives experienced C and object-oriented developers all the skills they need to use Objective-C, the preferred language for Cocoa development. Coverage includes: custom views; responders and keyboard events; fonts and NSString; pasteboards; categories; compilation with the GNU C (gcc) compiler; debugging with the GNU debugger (gdb); and much more. The book includes extensive code examples; most in Objective-C, some in Java.MARKET:For all professional programmers interested in developing for Mac OS X or curious about the Cocoa programming environment. Assumes knowledge of C and one object-oriented language, such as Java.



Acknowledgments.


1. Cocoa: What Is It?

A Little History.

Tools.

Objects, Classes, Methods, and Messages.

Frameworks.

How to Read this Book.

Typographical Conventions.

How to Learn.



2. Let's Get Started.

In Project Builder.

In Interface Builder.

Back in Project Builder.

Documentation.

What Have You Done?



3. Objective-C.

Creating and Using Instances.

Using Existing Classes.

Creating Your Own Classes.

The Debugger.

What Have You Done?

For the More Curious: How Does Messaging Work?

Challenge.



4. Controls.

Some Commonly Used Subclasses of NSControl.

Start the RaiseMan Example.

The Interface File for MyDocument.

Layout the Interface.

Implementing the Person Class.

Implementing the MyDocument Class.

What Have You Done?

For the More Curious: Setting the Target Programmatically.

Challenge.



5. Helper Objects.

NSTableView and Its Data Source.

MyDocument Interface File.

Layout the User Interface.

Make Connections.

Edit MyDocument.m.

Key-value Coding.

Delegates.

For the More Curious: How Delegates Work.

Challenge 1.

Challenge 2.



6. Archiving.

NSCoder and NSCoding.

The Document Architecture.

Saving and NSArchiver.

Loading and NSUnarchiver.

Informing the Document That It Has Been Edited.

Setting the Extension and Icon for the File Type.

For the More Curious: Preventing Infinite Loops.

For the More Curious: Versioning.

For the More Curious: Creating a Protocol.



7. Nib Files and NSWindowController.

NSPanel.

Adding a Panel to the Application.

For the More Curious: NSBundle.

Challenge 1.

Challenge 2.



8. User Defaults.

NSDictionary and NSMutableDictionary.

NSUserDefaults.

Creating Keys for the Names of the Defaults.

Registering Defaults.

Let the User Edit the Defaults.

Using the Defaults.

Saving the Frame of a Window.

For the More Curious: Reading and Writing Defaults from the Command-line.

Challenge.



9. Using Notifications.

What Notifications Are.

What Notifications Are Not.

NSNotification.

NSNotificationCenter.

Posting a Notification.

Registering as an Observer.

Unregistering the Observer.

Handling the Notification When It Arrives.

For the More Curious: Delegates and Notifications.

For the More Curious: The userInfo Dictionary.

Challenge.



10. Using Alert Panels.

Make the User Confirm the Delete.

Challenge.



11. Localization.

Localizing a Nib File.

String Tables.

For the More Curious: nibtool.

Challenge.



12. Custom Views.

The View Hierarchy.

Get a View to Draw Itself.

Drawing with NSBezierPath.

NSScrollView.

For the More Curious: Cells.

Challenge 1.



13. Images and Mouse Events.

NSResponder.

NSEvent.

Getting Mouse Events.

Using NSOpenPanel.

Composite an Image Onto Your View.

The View's Coordinate System.

Autoscrolling.

For the More Curious: NSImage.

Challenge.



14. Responders and Keyboard Events.

NSResponder.

NSEvent.

Create a New Project with a Custom View.



15. Working with Fonts and NSString.

NSFont.

NSAttributedString.

Drawing Strings and Attributed Strings.

Making Letters Appear.

Getting Your View to Generate PDF Data.

For the More Curious: NSFontManager.

Challenge 1.

Challenge 2.



16. Pasteboards and Nil-targeted actions.

NSPasteboard.

Add Cut, Copy, and Paste to BigLetterView.

Nil-targeted Actions.

For the More Curious: Which Object Really Sends the Action Message?

For the More Curious: Lazy Copying.

Challenge.



17. Categories.

Add a Method to NSString.



18. Drag and Drop.

Make BigLetterView a Drag Source.

Make a BigLetterView a Drag Destination.

Challenge.



19. NSTimer.

Layout the Interface.

Make Connections.

Adding Code to AppController.

Challenge.



20. Sheets.

Adding a Sheet.

For the More Curious: contextInfo.

For the More Curious: NSDrawer.

Challenge.



21. Creating NSFormatters.

A Basic Formatter.

The Delegate of the NSControl.

Checking Partial Strings.

The Control's Delegate and Partial Strings.

Formatters that Return Attributed Strings.

Challenge.



22. Printing.

Adding Printing to TypingTutor.

Dealing with Pagination.

Challenge.



23. Updating Menu_n.

Making a BigLetterView Uncopyable.



24. Working with NSTextView.

NSTextView.

Messages the Delegate Will Be Sent.

Build the Editor With Which This Book Was Written.

For the More Curious: The Field Editor.



25. Using Java with Cocoa.

Don't Use Java to Write Cocoa Applications.

If You Must Use Java to Write Cocoa Applications.



26. Creating Interface Builder Palettes.

Add NSCoding Methods to BigLetterView.

Create a Palette Project.

Edit the Nib File for Your Palette.

palette.table.

Build and Test.

FinishInstantiate.

Adding an Inspector.

For the More Curious: How to Palettize Objects That Are Not Views.

Challenge.



27. The End.


Index. 0201726831T10152001

Aaron Hillegass, who worked at NeXT and Apple, now teaches popular Cocoa programming classes at Big Nerd Ranch. At NeXT, he wrote the first course on OpenStep, the predecessor to today's Cocoa tools.This book is based on the Big Nerd Ranch course and is influenced by more than a decade of work with OpenStep and Cocoa.



The practical guide everyone says you need!

"The most comprehensive guide to developing Cocoa available. For the developer new to Cocoa, it provides an excellent introduction that will lead to success with the world's best object-oriented development tools. For those familiar with Cocoa, the excellent organization and presentation make the book invaluable as a reference tool."

--Bill Bumgarner, Cofounder, CodeFab

With the arrival of Mac OS X, Apple now has a modern operating system that calls for advanced programming capability. To take full advantage of the exciting and innovative features of OS X, Apple recommends a development framework known as Cocoa. Cocoa is a powerful collection of object-oriented tools and libraries that makes developing applications a much faster process. Mastery of Cocoa is absolutely essential for anyone doing serious development work for the Macintosh.

"Mac OS X and Cocoa are going to revolutionize the world of software development in the coming years... Aaron Hillegass's book is without a doubt the best aid to learning this technology."

--Erik J. Barzeski, Editor, CocoaDevCentral.com

New technologies often have a steep learning curve and do not always come with complete instructions on how to get started or how to overcome common obstacles. Enter Cocoa(R) Programming for Mac(R) OS X, which shows you precisely how to put Cocoa to work.

"Reading this book is the absolute best way to learn how to harness the power of this amazing technology."

--Andrew Stone, President, Stone Design, www.stone.com

Guiding programmers through the key features of Cocoa, this book emphasizes design patterns that enable you to predict the behavior of classes you have never used before. Using a tutorial format, it takes you, step-by-step, through five applications and an InterfaceBuilder palette. Each project introduces several new ideas, and as each concept or technique is discussed, the author, drawing on his own extensive experience, shows you the advantages of working with Cocoa in object-oriented software development environments.



0201726831B11262001

View a Sample Chapter PDF: /samplechapter/0201726831.pdf

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students, contact your Pearson Higher Education representative for pricing and ordering information.

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students contact your Pearson Higher Education representative.


Copyright ©2008 Pearson Education. All rights reserved. Legal Notice | Privacy Policy | Permissions