How do I implement saving and loading for simple files?
A new document-based application project comes with empty method implementations for dataRepresentationOfType: and loadDataRepresentation:ofType: in the custom subclass that is automatically created for you. You should implement these methods to support reading and writing of simple files if your application must be able to run on Mac OS X v10.3 or earlier. For applications that can require Mac OS X v10.4 and later, override dataOfType:error: and readFromData:ofType:error:, respectively, instead. For example implementations of those overrides, see “Implementing a Document-Based Application” and the Sketch example application at /Developer/Examples/AppKit/Sketch/. The dataOfType:error: method should provide the contents of the document as an NSData object, formatted as the requested type. The readFromData:ofType:error: method should be able to read in the document contents from the given NSData, interpreting the data as the given type. If your document saves document as file wrappers or