Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I implement saving and loading for simple files?

0
10 Posted

How do I implement saving and loading for simple files?

0
10

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123