• 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
Doc based app - creating a document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Doc based app - creating a document


  • Subject: Doc based app - creating a document
  • From: Chris Idou <email@hidden>
  • Date: Thu, 31 Jul 2008 21:09:43 -0700 (PDT)

I've got a core-data document based app. I need to programmatically create or open a document at a programmatically chosen location and display it in a window. This is what I tried:

[[NSDocumentController sharedDocumentController] makeDocumentWithContentsOfURL:url ofType:mytype error:&error];
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:url display:YES error:&error];

This opens a new window, but when I hit command-S to save it says it doesn't know where to save and prompts me, despite me having supplied the URL of where to save it. However the default location it prompts is the correct location.

Then after I save it, I was hoping just the call to openDocumentWithContentsOfURL: would open it again, but that doesn't seem to do anything.

Are there some other APIs I need to be looking at?






_______________________________________________

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

  • Prev by Date: Re: Adding an NSColor subclass to NSColorPanel?
  • Next by Date: Re: NSTextView + other NSView in NSScrollView?
  • Previous by thread: Getting the id of a button in a NSCollectionView
  • Index(es):
    • Date
    • Thread