currentDocument
currentDocument
- Subject: currentDocument
- From: "gMail.com" <email@hidden>
- Date: Tue, 02 Dec 2008 17:06:38 +0100
- Thread-topic: currentDocument
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 (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