Hi,
I use to get the currentDocument this way
    [[NSDocumentController sharedDocumentController] currentDocument]
It works well but not in the following case

My apps opens automatically a document with
    - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName
    error:(NSError **)outError
Here I load my docFile in a NSDictionary mDocDict

Then, later in the method
    - (void)windowControllerDidLoadNib:(NSWindowController*)aController
I really build my objects using the dictionary mDocDict. But at this point
    [[NSDocumentController sharedDocumentController] currentDocument]
returns nil and I can't get some variables I really need.


How to fix this?
The Docs suggest to use
    [[[self window] windowController] document];
But I can't really use this solution all over my code. Some objects have no
window.


Best Regards
--
LL


_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to