Save a MathPaper file containing several calculations and then view
the contents of the file in a Terminal window with the
cat
command (or by using an editor). Look up and
identify any RTF commands that we didn’t discuss in
Chapter 12.
Reimplement the methods dataRepresentationOfType: and loadDataRepresentation:ofType: so that the
NSData object contains a serialized NSDictionary object that itself
contains the window’s history
and
frame
. The advantage of using an NSDictionary
object for archiving is that it can give you both forward and
backward compatibility with your saved documents — provided that
later versions create the fields that the older versions expect to
find.
Reimplement the methods dataRepresentationOfType: and loadDataRepresentation:ofType: so that the
NSData object contains an XML representation of the
window’s history
and
frame
. What are the advantages of using XML?
Add a calculator-like keypad to MathPaper so that users can click buttons to create mathematical expressions in MathPaper’s key window. Implement this so that only one of these calculator-like keypads is needed for all of MathPaper — the new window should be a floating panel (utility window) that automatically inserts characters into the key window.
For each MathPaper document window, add an auxiliary window that
displays the contents of the history
instance
variable as it’s being filled with mathematical
expressions and results. You will need to upgrade the MathDocument
class and create a separate NSWindowController object for each new
auxiliary window.
18.218.224.226