How do I read RTFD files into a view?
How do I read RTFD files into a view?
- Subject: How do I read RTFD files into a view?
- From: "Alan Smith" <email@hidden>
- Date: Wed, 24 May 2006 18:29:10 -0400
I can't get an NSView to replace its contents with the contents of a
RTFD file. I tracked the problem and it's that the NSData pointer
never loads the data.
NSData *rtfdData;
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{
rtfdData = [NSData dataWithContentsOfFile:filePath];
NSLog(@"file does exist");
}
[helpViewer replaceCharactersInRange:NSMakeRange(0, [[helpViewer
string] length]) withRTFD:rtfdData];
NSLog(@"help file loaded: %@", filePath);
filePath is the path of the file I want it to load. :) helpViewer is a
NSTevtView. When I run this it does print out "file does exists but
can't load the data. What's up with that?
Also, how do I load an array of paths made from the contents of a
folder excluding the RTFD subpaths? The folders contents would be RTFD
files but I don't want the '.typeAttributes.dict' and all the other
files inside a RTFD file to be in my array.
Thanks, Alan
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
_______________________________________________
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