Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Doc based app - creating a document



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.