• 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
Opening a document from stationery
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Opening a document from stationery


  • Subject: Opening a document from stationery
  • From: Graham Cox <email@hidden>
  • Date: Sat, 11 Oct 2008 16:15:11 +1100

I want to implement opening a document from stationery. This opens a new 'untitled' document but preloaded with the content from the template file. It's pretty much working using the following code:

NSDocument* newDoc = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:url display:YES error:&outError];

	[newDoc setFileURL:nil];

But you can see the window title briefly display the original filename before being set to 'untitled'. To try and fix that I tried passing NO in the display: parameter, then calling -showWindows after setting the URL to nil, but that doesn't show anything at all.

So, what's the right way to handle this?

tia,

Graham
_______________________________________________

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: Opening a document from stationery
      • From: "Ashley Clark" <email@hidden>
  • Prev by Date: Re: How do I debug this? [SOLVED]
  • Next by Date: Add animation layer and then remove animation layer
  • Previous by thread: Re: NSTableView and drag and drop
  • Next by thread: Re: Opening a document from stationery
  • Index(es):
    • Date
    • Thread