| Article: |
Giving the Simple Text Editor 'Legs' | |
| Subject: | SimpleTextEditor documents don't load in TextEdit | |
| Date: | 2002-01-06 12:19:21 | |
| From: | snackdog | |
|
This was a great article. I was able to save and open documents with my SimpleTextEditor with no problem. When I double-clicked one of my saved documents, the Finder launched TextEdit and it was not able to display my .rtfd document correctly -- it showed the internal rtf info. When I opened a file with a graphic saved in TextEdit in SimpleTextEditor, I got an error: loadFileWrapperRepresentation:ofType: must be overridden if your document deals with file packages.
|
||
Showing messages 1 through 1 of 1.
-
SimpleTextEditor documents don't load in TextEdit
2002-01-13 14:43:17 xbhoff [View]



RTFD files created and saved in TextEdit (containing a graphic, for example) are "openable" in this app but do not load.
If you tweak the code in this cocoa app to make it open and save files of type "rtf" (not "rtfd"), files created and saved in this cocoa app will open correctly in TextEdit. TextEdit files saved as "rtf" files (no graphics or attachments, just rich text content) will open correctly in this cocoa app.
I changed the code for data type from RTFD to RTF in two places:
NSMakeRange(0,0) withRTF:fileData
-- and --
return [textView RTFFromRange:range];
also, I changed application signature and document type extension and OS type accordingly.
This suggests to me that there is something wrong with the methods RTFDFromRange and NSMakeRange(0,0) with RTFD, or something wrong with this code that our author needs to address. The resulting file structure that gets created this way is not the same file structure as an RTFD doc created with TextEdit.
Even though the article is now several months old, its the first starting point for many people, I presume, and this kind of issue needs to be addressed by the author.
Mike, please investigate and explain.