Building Cocoa Applications: A Step by Step Guide
|
| List Price: | £49.99 |
| Price: | £42.49 & eligible for FREE Super Saver Delivery. Details |
Availability: Usually dispatched within 24 hours
Dispatched from and sold by Amazon.co.uk
Product Description
This guide 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, colour, mouse events, zoom buttons, pasteboards, services, preferences, and the defaults database.
Product Details
- Amazon Sales Rank: #532716 in Books
- Published on: 2002-05-01
- Original language: English
- Number of items: 1
- Binding: Paperback
- 648 pages
Editorial Reviews
From the Publisher
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. 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.
About the Author
Simson Garfinkel, CISSP, is a journalist, entrepreneur, and international authority on computer security. Garfinkel is chief technology officer at Sandstorm Enterprises, a Boston-based firm that develops state-of-the-art computer security tools. Garfinkel is also a columnist for Technology Review Magazine and has written for more than 50 publications, including Computerworld, Forbes, and The New York Times. He is also the author of Database Nation; Web Security, Privacy, and Commerce; PGP: Pretty Good Privacy; and seven other books. Garfinkel earned a master's degree in journalism at Columbia University in 1988 and holds three undergraduate degrees from MIT. He is currently working on his doctorate at MIT's Laboratory for Computer Science.
Michael K. Mahoney is Dean of the College of Engineering at California State University, Long Beach, where he is also a Professor of Computer Engineering and Computer Science. Formerly, he was the Associate Vice President for Academic Information Technology and Chair of the Department of Computer Engineering and Computer Science. Dr. Mahoney started programming at NeXT Computer, Inc. in January 1989 and coauthored (with Simson Garfinkel) NeXTSTEP Programming, Step One: Object-Oriented Applications (Springer-Verlag). He has given presentations on object-oriented programming and NeXTSTEP's Interface Builder at ACM meetings in Seattle, Los Angeles, Monterey, and New Orleans. Before becoming dean, he regularly taught university courses in computer graphics, user interface design, object-oriented programming, discrete mathematics, and web development. He has supervised eight Master's theses. Mahoney earned his Ph.D. in mathematics at the University of California, Santa Barbara, in 1979. He has published papers in computer graphics, computer science education, and mathematics. He has won campuswide teaching awards at both UCSB and CSULB. His web site is http://www.csulb.edu/~mahoney/.
Excerpted from Building Cocoa Applications : A Step by Step Guide by Simson Garfinkel, Michael K. Mahoney. Copyright © 2002. Reprinted by permission. All rights reserved.
Chapter 5 - Building a Project: A Four-Function Calculator
In this chapter, we'll build a simple Calculator application with four functions: add, subtract, multiply, and divide. When we're done, our Calculator will contain the menu and window shown in Figure 5-1. In the process of building the Calculator, we'll learn about Interface Builder, connections, and some of the commonly used Cocoa Application Kit (AppKit) classes.
We've chosen to build a calculator as the first "real" application in this text for several reasons. First, calculators are familiar; we've all used one, and we sort of know how they work. (When creating an application, the first thing to understand is the problem you need to solve.) Second, calculators are useful. As programmers, we're constantly having to do silly little things like add two numbers together or convert a number from decimal to hexadecimal (the hex part will be built in Chapter 7). It's a tool that you can put to work after you build it.
More importantly, a calculator is a good starting point for budding Cocoa developers. In subsequent chapters, we'll use the Calculator as an infrastructure for learning about Cocoa graphics, printing, multiple windows, file handling, and many other features.
Creating your own calculator puts you in charge of its design. After all, there are many kinds of calculators: some are scientific, some are financial, and some are just simple four-function calculators. Our Calculator will let you key in the sequence "3+4=" by clicking four buttons in a window. The Calculator will display (in order) 3, 3, 4, and 7 in a text output area. If you don't like the decisions we've made and want to change or add functions and features, go right ahead! Our aim is to give you the know-how to create your own applications.
Getting Started: Building the Calculator Project
Follow these steps carefully to get started building your Calculator project:
Make sure that the Project Builder and Interface Builder icons are in your dock, then launch PB from your Dock.
Choose Project Builder Hide Others to simplify your screen.
Choose PB's File New Project menu command to begin the process of creating a new project (see Figure 5-2). The New Project Assistant dialog opens.




