NSDocument - NSSaveOperation disables Save Menu Item
NSDocument - NSSaveOperation disables Save Menu Item
- Subject: NSDocument - NSSaveOperation disables Save Menu Item
- From: Denise Eatherly <email@hidden>
- Date: Wed, 7 Mar 2007 13:44:28 -0700
Hi,
Has anyone implemented saveAs directly on an NSDocument subclass?
I'd like to provide an option that gets a directory from the user &
then saves a few auxiliary files into that directory and finally
saves the currently active document into the directory as well.
When this happens, it should act like a 'Save As' in that any future
saves should affect the newly created file. As the user already
provided the destination directory, the Save Panel shouldn't come up
again. So, using NSDocument's saveDocumentAs: won't do it, as far as
I can tell.
I've tried [ myDocument saveToURL:newURL ofType:myType
forSaveOperation:NSSaveOperation error:&anError ]; Basically, it
seems to work. However, once it executes, the Save item in the File
menu becomes disabled. The document window correctly shows as edited
when changes are made and if I try to quit, it brings up the panel
reminding me that there are changes. Selecting Save at that point
saves into the correct file. I have tried explicitly setting the
document's fileURL and fileName after the save operation as well as
updating the changeCount. No joy. Does anyone know what could be
causing this? or what to do about it?
Any suggestions are much appreciated.
Thanks,
Denise
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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