Building Cocoa Applications: A Step by Step Guide
Publisher: O'Reilly Media
Released: May 2002
Pages: 648

Cocoa is an object-oriented development environment available in Apple's Mac OS X environment. Mac OS X, a unified operating system and graphical operating environment, is the fastest growing Unix variant on the market today. Hard-core Unix programmers, developers who cut their teeth on classic Mac operating systems, and developers who cherished NeXTSTEP, the decade-old system on which today's Cocoa is based -- all are flocking to Cocoa, and they need a lot more practical information than is currently available from Apple. There is a lot to learn.

Building Cocoa Applications is an ideal book for serious developers who want to write programs for the Mac OS X using Cocoa. It's a no-nonsense, hands-on text that's filled with examples -- not only simple and self-contained examples of individual Cocoa features, but extended examples of complete applications with enough sophistication and complexity that readers can put them to immediate use in their own environments.

Building Cocoa Applications takes a step-by-step approach to teaching developers how to build real graphics applications using Cocoa. By showing the basics of an application in one chapter and then layering additional functionality onto that application in subsequent chapters, the book keeps readers interested and motivated. Readers will see immediate results, and then go on to build onto what they've already achieved.

The book is divided into four major parts:

Part I introduces the Mac OS X graphical user interface (Aqua) from a developer's point of view, Cocoa developer tools (such as the Interface Builder, Project Builder, and gdb debugger), object-oriented concepts, the Objective-C language in which Cocoa is written, and the basics of Cocoa programming itself.

Part II focuses on building the first complete application, Calculator, a simple four-function calculator. The chapters in this part of the book extend the application, piece by piece, by introducing such features as nibs, icons, delegation, resizing, events, and responders.

Part III focuses on building an application called MathPaper, which is similar to a word processor but which instead solves mathematical expressions the user supplies. The chapters in this part of the book extend MathPaper by developing both the front and back ends using a variety of Cocoa classes and methods. They introduce Cocoa'sdocument-based architecture, tasks, pipes, Rich Text format, handling document files, and using Quartz to draw in windows.

Part IV focuses on building the GraphPaper application, a more complex multithreading application that graphs mathematical functions in multiple dimensions and that uses mouse-over capabilities to identify graph points. The chapters in this part of the book add more advanced Mac OS X features such as multithreading, color, mouse events, zoom buttons, pasteboards, services, preferences, and the defaults database.

By the end of the book, readers who have built the applications as they have read will have a solid understanding of what it really means to develop complete and incrementally more complex Cocoa applications.

The book comes with extensive source code available for download from the O'Reilly web site, along with an appendix listing additional resources for further study.

Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyBuilding Cocoa Applications: A Step by Step Guide
 
3.3

(based on 22 reviews)

Ratings Distribution

  • 5 Stars

     

    (6)

  • 4 Stars

     

    (6)

  • 3 Stars

     

    (2)

  • 2 Stars

     

    (5)

  • 1 Stars

     

    (3)

Reviewed by 22 customers

Sort by

Displaying reviews 1-10

Back to top

Previous | Next »

(1 of 1 customers found this review helpful)

 
2.0

The easy way to write a book

By gg

from UK

Verified Reviewer

Pros

  • Helpful examples

Cons

  • Difficult to understand
  • Not comprehensive enough
  • Too basic
  • Too many errors

Best Uses

  • Novice

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

The book is centered on a calculator application (I think I remember another book with another calculator for MacOS 7) that gets unduly complicated in successive chapters. Now that is useable if it works, if you have lots of time and then you alter it and watch what happens. The problems are,
* it does not work (typos, inaccuracies)
* when it doesn't, you are on your own (no good explanation about the debugger, nor about where to look)
* the Cocoa documentation is humungous and the book should give us some more entry points, otherwise it is easier to reprogram something than to find its name using what you have.
Some concepts (like the responder chain to treat messages to objects like a window) are explained, but I have the impression that the authors explained what was the easiest to explain (the first 80-ish pages are about the Mac user interface and basic tools). When you want to find out eg. how to address an object (like for making one palette for several documents), again you are on your own.
Another problem is, the book has become obsolete with MacOs evolving - better explanations could have avoided this effect.

(1 of 1 customers found this review helpful)

 
3.0

Building Cocoa Applications: A Step-by-Step Guide Review

By ++

from Undisclosed

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

Hmm, very extreme posts here. Actually I think its average book, not good not bad, just average book. But I wouldnt buy it for second time:-)

Emur

(0 of 1 customers found this review helpful)

 
1.0

Building Cocoa Applications: A Step-by-Step Guide Review

By Susan Cook

from Undisclosed

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

Yong lee!I loved your reveiw and I totally agree with you.It had so many mistakes!

(2 of 2 customers found this review helpful)

 
4.0

Building Cocoa Applications: A Step-by-Step Guide Review

By Peter Gatti

from Undisclosed

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

At last a book that has given me a general idea of what Cocoa is all about. My only background in programming is with Future Basic, a hybrid basic that adopts the program layout of C by replacing goto's with functions but keeps the terms of the language intact. It wasn't until I played around Interface Builder that I knew I had to learn Cocoa. I did a quick read of C fundamentals and found it wasn't much different than Future Basic other than the syntax of C seem more awkward to me. But I'll get use to it.

First I read Inside Mac OS X The Objective-C Programming Language included with the Developer tools. The first part of the book describing the concept of Objects is easy to understand, but when I reached the Objective C Language section I became totally lost.

Then I bought Cocoa Programming by Anguish, Buck, and Yacktman. Same scenario, I understand the first few chapters and then suddenly find myself reading technical jargon that is gibberish to me.

Next I bought Cocoa Recipes for Mac OS X by Cheeseman, once again it started off OK but since it was written by a lawyer, I soon found myself lost in the same way one might find oneself confused by a legal document.

I'm not downing any of these publications, they're just too technical for me at this stage and they'll probably do me some good once I complete Building Cocoa Applications. This is the first book that has given me the overall picture of Cocoa without swamping me with specifics. Now I at last have a starting point for learning and understanding the specifics.

I haven't tried entering any code yet and from the comments given here it's riddled with inaccuracies, but who cares when I can download the code and refer to that. With all it's faults, this is the one book that has put me on track.

 
2.0

Building Cocoa Applications: A Step-by-Step Guide Review

By JongAm Park

from Undisclosed

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

This book contains good examples.

However there are some flaws. As other people mentioned it, this book suffers lots

of typos, which are not just errors in typed characters but also the explanation.

Unlike other programming environment, Cocoa programming with Interface Builder uses mouse-work like drag-and-drop for "programming" not just editing. What I mean

is to connect outlet to some classes represented as graphical element in the Interface Builder. So, if there is some "missing" sentence, then the code is not going to work, and it's hard to find what error you have. Because of this, you can't use "diff" for finding errors with the code examples downloadable from the Oreilly's web site some times.

So, how much writing errors in this book is very important to gauge how well written this book is. So, this books should be revised seriously.

Second, multiprocessing sample doesn't seem like serious multiprocessing example,

although it's good example. There is no example which uses "fork" and "join" seriously. Whether they are wrapped or not.

 
3.0

Building Cocoa Applications: A Step-by-Step Guide Review

By Richard Hough

from Undisclosed

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

A flawed masterpiece.

I have bought a couple of Cocoa programming books and, superficially, this one is the best of the lot. The examples are real, working applications and not code snippets. Moreover, they often involve "cool" features like graphics, integration with the BSD layer, and Mac-specific things like the pasteboard or Services.

The exercises are also emotionally satisfying because you quickly get something that looks pretty; often after doing one I run to my S.O. saying "look at this!"

Unfortunately this is also related to the first of two flaws with the book. The coverage is very superficial; the exercises are all recipies where you type in the magic code, click "run" and ooooh! Look at the pretty pictures! They don't explain how the "magic code" works in any detail, or tell you what to do if you get runtime errors instead of pretty pictures.

And runtime errors are what you'll often get. The second, and most crippling, flaw with this book is that it is riddled with errors; typos, inaccurate information, missing steps, hand-waving non-explanations of important concepts. I have consulted the 18 pages of errata for the book, and still about half the time the application doesn't work right when I run it. The errors are usually things like missing environment variables, conflicting line endings or character encodings, differing system preferences, or other such machine-specific stuff.

The book should cover debugging in more detail. It should have a section on using GDB. The examples should have steps where you validate your configuration against what the authors are expecting. The "magic code" should include error checking. If the second version includes this, it will be the masterpiece this one should have been.

(0 of 1 customers found this review helpful)

 
2.0

Building Cocoa Applications: A Step-by-Step Guide Review

By jda

from Undisclosed

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

In general, a good step-by-step overview of Cocoa programming and Objective-C. Unfortunately, I cannot recommend this book as there are major flaws in Chapter 10 and as of Jan 11th 2003, the downloaded tar file (once decompressed) cannot be read or expanded. Chapter 10 deals with renaming several default files. Several critical steps are missing as the applicaiton can no longer produce document windows.

 
4.0

Building Cocoa Applications: A Step-by-Step Guide Review

By Frederick C. Lee

from Undisclosed

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

The book is well-planned and logical in its approach. It covers some key items to Cocoa programming in quite detail vs other books.

However, I found errors and my edition (May 2002) doesn't have some of the Jaguar stuff. For example, on Page 323 the author refers to 'Tool' as the New Target for the Project Builder. But my newer version of PB has 5 different tools versus just one. I'm clueless as to which tool to use/develop.

Also, the 'evaluator' example within the Unix environment isn't laid out very explicit. I can't get my makefile to compile correctly. Perhaps it's a missing TAB or SPACE in the code, I don't know. It's hard to follow.

And I can't de-arc the example codes from the web site.

Other than that, It's a good 1st edition that will probably get better in the 2nd edition and beyond. Hence I recommend this book.

(0 of 1 customers found this review helpful)

 
2.0

Building Cocoa Applications: A Step-by-Step Guide Review

By William

from Undisclosed

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

Overall, Building Cocoa Applications is a good introductory book and since I received it for free at WWDC 2002 I shouldn't complain too much. However, the code in this book is full of errors and inconsistancies. Many times after typing in the code from the book, I was disappointed that it would not compile. I had to read over the example code to find the errors. Several times the dealloc method was left out completely. And a simple thing like a missing semicolon (code, p. 479) demonstrates to me that this book was not proofread at all. As a beginner, learning programming, OO concepts and Cocoa, I'm very frustrated with the many errors which have wasted many hours. I guess I've learned a lot from fixing the errors but I hope this was not intended by the authors. I can only guess that since the example code is dated Feb. 2002 that the book was rushed to press so it would be ready for WWDC in May. And that's a shame because without quality prooffreading this book is not up to the standard of O'Reilly books which I have come to expect and depend on. And four months later still no official errata.

It's not my intention to insult or hurt anyone's feelings (authors, technical reviewers, O'Reilly staff) but this book needs work and I would recommend readers wait until a second edition is published. I can recommend Aaron Hilligass' book "Cocoa Programming for Mac OS X" which is close to being error free and also easier for a beginner to read.

(2 of 2 customers found this review helpful)

 
4.0

Building Cocoa Applications: A Step-by-Step Guide Review

By Paul Jager

from Undisclosed

Comments about oreilly Building Cocoa Applications: A Step by Step Guide:

I was lucky enough to receive my copy for free at the recent WWDC 2002, which I attended as a student. I can understand some people are frustrated by some errors here and there, but having no background in objective C and having only been taught Java at uni, I could easily work out and fix the errors in code, and have gotten the applications to work with little effort: mostly they are obvious. I would suggest that people not let these slights put them off getting a copy...I am extremely impressed with the incredible power of OSX, and found that I learnt more about OOP through this book over the uni break than my 3 years at uni studying computer systems engineering. Its amazing, that in a few hours I understood the practical meaning of all that deisgn pattern stuff we brushed over at uni this year (like proxy pattern etc, delgates...)

Keep up the good work o'reilly!

Displaying reviews 1-10

Back to top

Previous | Next »

 
Buy 2 Get 1 Free Free Shipping Guarantee
Buying Options
Immediate Access - Go Digital what's this?
Print: $64.99