Skip to Content
Building Cocoa Applications: A Step by Step Guide
book

Building Cocoa Applications: A Step by Step Guide

by Simson Garfinkel, Michael Mahoney
May 2002
Intermediate to advanced
646 pages
18h 57m
English
O'Reilly Media, Inc.
Content preview from Building Cocoa Applications: A Step by Step Guide

Chapter 10. MathPaper and Cocoa’sDocument-Based Architecture

In this chapter and in Chapter 11 through Chapter 14, we are going to start over and build a new, more sophisticated calculator-like application called MathPaper . MathPaper will manage multiple windows, use fonts to convey information, and use interprocess communication to make a request to another (back end) program to do the actual calculation. In writing MathPaper, we will learn a lot more about Cocoa’s architecture for creating applications that handle documents in multiple windows.

The MathPaper Application

When we’re done, MathPaper will be a scratchpad mathematics application that looks like a text editor: it will display a little text window into which you can type mathematical expressions. The neat thing about MathPaper is that when you hit the Return key, the application will automatically calculate the value of the mathematical expression that you’ve typed and display the result. Figure 10-1 contains an example of MathPaper running with three windows open.

MathPaper window with mathematical expressions and results

Figure 10-1. MathPaper window with mathematical expressions and results

MathPaper can handle multiple windows: typing Command-N will give you another “piece” of “math paper.” In later chapters of this book, we’ll use part of MathPaper to graph equations as well. MathPaper has four main parts:

Document-based architecture

Cocoa’s powerful document-based architecture ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Cocoa and Objective-C: Up and Running

Cocoa and Objective-C: Up and Running

Scott Stevenson
Learning Cocoa with Objective-C, 2nd Edition

Learning Cocoa with Objective-C, 2nd Edition

Apple Computer Inc, James Duncan Davidson
Learning Cocoa

Learning Cocoa

Jonathon Manning, Tim Nugent, Paris Buttfield-Addison

Publisher Resources

ISBN: 0596002351Catalog PageErrata