Re: Changing name of newly created NSDocument (instead of 'Untitled i')
Re: Changing name of newly created NSDocument (instead of 'Untitled i')
- Subject: Re: Changing name of newly created NSDocument (instead of 'Untitled i')
- From: Dave Geering <email@hidden>
- Date: Wed, 13 May 2009 12:07:43 +1000
On Wed, May 13, 2009 at 6:37 AM, Sean McBride <email@hidden> wrote:
> Hi all,
>
> My doc-based application is able to import foreign file formats. I do
> this by creating a new instance of my NSPersistentDocument subclass and
> populate it as needed.
>
> Works fine, but results in a document named "Untitled i". Is there a
> way to name it something like "original_filename (Converted)"?
> setFileURL: doesn't seem appropriate since I don't want to ask the user
> to choose an on-disk location.
>
> Thanks,
>From memory, you can override -displayName and return a string to
display in the title bar, which can be any arbitrary string. I'm not
sure what else -displayName is used for but I think it is entirely
independent from the filename.
Cheers,
Dave.
_______________________________________________
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