Exporting a csv file, printingAny respectable document-based application should allow the user to print. Just for fun, I added a toolbar (as described briefly here) and put in a print toolbar item. It turns out to be hooked up automatically. You just have to implement the function below in MyDocument. The current version doesn't handle page setup properly---I'll have to explore that further. The dictionary we get passed is empty.
The other code listing is to export a CSV (comma separated values) file, that could be imported into a spreadsheet. This is just like a standard file save for a non-document based application. It uses a block as the "completionHandler," which I also discussed briefly the other day.