Getting filename in NSDocument readFromData
Getting filename in NSDocument readFromData
- Subject: Getting filename in NSDocument readFromData
- From: Pascal Harris <email@hidden>
- Date: Wed, 28 Apr 2010 19:37:05 +0100
How do I get the filename of the source document when using NSDocument readFromData?
By and large, readFromData works excellently. My app is able to get the NSData object and process it and all works well. But now I want to write a refinement which would require my app to pass details (i.e. the file name and path) of files that it can't understand natively to a helper application (if present). In order to do this I need to know how to get the filename and path within readFromData. Given that NSDocument displays the name and path (when command clicking) of documents that it can read in the window title, this information is clearly somewhere!
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError
{
BOOL success = NO;
success = [self loadTextViewWithInitialData: data]; // I need to either perform the check and processing here or in loadTextViewWithInitialData
return success;
}
Thanks in advance, Pascal_______________________________________________
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