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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to