Re: NSDocument and default file names.
Re: NSDocument and default file names.
- Subject: Re: NSDocument and default file names.
- From: Godfrey van der Linden <email@hidden>
- Date: Wed, 18 Jun 2008 08:13:45 +1000
Thanks. It was indeed overriding the displayName, obvious when you
think about it. I think I'll ping docs and ask them to add a comment
to that effect to [NSDocument displayName].
Godfrey
On 2008-06-18, at 6:27 AM, Quincey Morris wrote:
On Jun 17, 2008, at 00:36, Godfrey van der Linden wrote:
I have been lurking on this list for a while. It is interesting to
be on the other side, I used to hang around answering questions on
the kernel lists oh well, even kernel developers can become indie
development occasionally ;-)
When I create a new NSPersistentDocument, I recognise it is new and
ask the user a series of questions to configure the software. From
the questions I ask I can get a pretty good guess at what the
basename of the new document will be, I just don't want to guess
what the directory will be.
So here is my issue. How do I suggest to the persistent document
that it should default the filename to the one I suggest and not
use 'untitled'. If I was using NSSavePanel directly I'd just tell
it what I wanted but the NSDocument is trying to be helpful! Is
this just a case of not trying to program around the libraries?
I think overriding -[NSDocument displayName] (to return your
proposed name for new documents) will do what you want. IIRC, that's
where the name shown in the initial Save dialog comes from. If, in
addition, you want the window titles to indicate the difference
between a new and an already-saved document, you could use -
[NSWindowController windowTitleForDocumentDisplayName:] to further
customize window titles without messing up the name in the Save
dialog.
_______________________________________________
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
_______________________________________________
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