• 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
Re: Loading a default file in doc based app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading a default file in doc based app


  • Subject: Re: Loading a default file in doc based app
  • From: Robert Cerny <email@hidden>
  • Date: Sat, 20 Mar 2004 20:42:39 +0100

Hi,
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:thePath display:YES]

Returns an NSDocument object created from the contents of the file fileName (an absolute path) and displays it if flag is YES. The returned object is not retained, but is added to the receivers list of managed documents. Returns nil if the object could not be created, typically because fileName does not point to a valid file or because there is no NSDocument subclass for the document type (as indicated by the file extension or HFS file type). Even if flag is YES, the document is not displayed if shouldCreateUI returns NO. This method invokes makeDocumentWithContentsOfFile:ofType: to obtain the created NSDocument object. If you override this method, your implementation should be prepared to handle either YES or NO.


HTH
Robert

On 20.3.2004, at 19:57, Fabio Genoese wrote:

Hello,

I've searched the archives and I found this hint:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:thePath display:YES]
}

I've added this code to my AppController. Unfortunately, it returns null although I'm 100% sure that the path is correct. Anything I've missed?

thanks,
Fabio
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Loading a default file in doc based app (From: Fabio Genoese <email@hidden>)

  • Prev by Date: Re: Programmatically Create Login Item
  • Next by Date: Problems with tabbing between custom text fields
  • Previous by thread: Loading a default file in doc based app
  • Next by thread: Re: Programmatically Create Login Item
  • Index(es):
    • Date
    • Thread