Implementing saving & loading
Implementing saving & loading
- Subject: Implementing saving & loading
- From: Mark Dawson <email@hidden>
- Date: Wed, 16 Aug 2006 17:21:18 -0700
I can't seem to figure out how saving and loading works:
I've implemented - (NSData *)dataRepresentationOfType:(NSString *)type;
However, when I do a "save as?", the correct NSTextView's content gets written out (rtf form), but my dataRepresentationOfType isn't called. I haven't implemented writeToFile or the wrapper function.
- Where might Cocoa be getting the text from (how does it know WHICH NSTextView to grab from)?
- How do I get it to call my NSDocument (custom) dataRepresentationOfType?
For reading, I want a double click to launch my app and create a new document; however, while a double click DOES launch my app (or brings an already launched one forward), nothing else happens. I have set the "document type" to my custom document (MyNSDocument), but that doesn't get called (or the loadDataRepresentation: isn't called)?
If I do an open, loadDataRepresentation DOES get called.
- What do I need to do to get a new document?
I've done this without problems on other programs, but I've done (or failed to set) something that I can't figure out?
Thanks for an suggestions,
Mark
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden