advertisement

Article:
  Giving the Simple Text Editor 'Legs'
Subject:   SimpleTextEditor documents don't load in TextEdit
Date:   2002-01-13 14:43:17
From:   xbhoff
Response to: SimpleTextEditor documents don't load in TextEdit

RTFD files saved from this cocoa app will not open in TextEdit, only in itself.


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.