Summary

We began this chapter by adding the Evaluator back end we created in the previous chapter to the MathPaper project. Then we created a new subclass of NSWindowController, called PaperController, where we put most of our “controlling” code — the code that ties our lex- and yacc-built back end together with the Cocoa-supplied document front end. MathPaper’s parts (Evaluator, document architecture, PaperController) fit the model-view-controller paradigm nicely. Along the way, we discovered a few issues with our program and learned a bit about Unix processes and some powerful classes (such as NSTextView) in order to take care of those program issues.

We can still improve MathPaper considerably. For example, the text output in the windows is plain, and we haven’t done anything about file operations such as printing, saving, opening, and so on. In the coming chapters, we’ll start working on solving these shortcomings.

Another important thing missing from the MathPaper application is the ability to save and load files. We’ll learn how to do that in Chapter 13.

Get Building Cocoa Applications: A Step by Step Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.