• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
currentDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: currentDocument
      • From: "Michael Ash" <email@hidden>
    • Re: currentDocument
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: Shouldn't NSOpenPanel media browser aliases be resolved before type check?
  • Next by Date: Re: Hide / show password in NSTextField / NSSecureTextField
  • Previous by thread: popup grid menu
  • Next by thread: Re: currentDocument
  • Index(es):
    • Date
    • Thread