Loading RTF Problem
Loading RTF Problem
- Subject: Loading RTF Problem
- From: Luke Pike <email@hidden>
- Date: Wed, 24 Oct 2007 17:38:18 -0400
Hi everybody.
I know this has been asked before, but I could not find any clear
answers on the list or anything that worked.
I'm using the standard NSDocument methods for saving and loading.
Saving works fine, as I can open it up in TextEdit. However, it won't
load it back into my textview. Here is the code from MyDocument.m.
- (NSData *)dataRepresentationOfType:(NSString *)aType
{
return [textView RTFFromRange:NSMakeRange(0, [[textView string]
length])];
}
- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType
{
[textView replaceCharactersInRange:NSMakeRange(0, [[textView string]
length]) withRTF:data];
return YES;
}
Again, saving works fine. Loading doesn't. Can some tell me why this
won't work? Thanks.
- Luke
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden