NSTextView and sound/movie attachments
NSTextView and sound/movie attachments
- Subject: NSTextView and sound/movie attachments
- From: Ivan Pinzon <email@hidden>
- Date: Fri, 3 Dec 2004 19:01:06 -0500
Hi there:
I have an NSTextView where users can drag sound/movie files. I want to
save/read the RTFD data, something like this:
i) save
NSData * textData = [mTextViewOutlet RTFDFromRange:NSMakeRange(0,
[[mTextViewOutlet textStorage] length])];
and then either archive it or writeToFile it
ii) read
mTextData = [[NSUnarchiver unarchiveObjectWithFile: fileName] retain];
// and then ...
[mTextViewOutlet replaceCharactersInRange:
NSMakeRange(0, [[mTextViewOutlet textStorage] length])
withRTFD:mTextData];
The problem is when reading, I get the tiff icon for the sound/movie
instead of the controller.
Image files work ok.
I checked the code for TextEdit, and saw that it uses:
- (NSFileWrapper *)RTFDFileWrapperFromRange:(NSRange)range
documentAttributes:(NSDictionary *)dict;
The thing is I need to be able to store the RTFD (or attributed string)
in my own archived object.
How can I do this? How can I restore the RTFD back into the NSTextView?
Thanks for any help.
Ivan Pinzon.
_______________________________________________
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