tags:

views:

44

answers:

1

Hi,

I want to give my app, which currently simply saves out folders, the option of giving these folders file extensions (for saving packages).

At the moment, when I do 'saveDocumentAs:', I get the save sheet with 'Untitled' as the suggested filename, how can I optionaly make it say (for example) 'Untitled.myext'?

Cheers

MT

A: 

NSDocument is supposed to require whatever file extension is configured for your document in your Info.plist. Is it possible the "Hide extension" checkbox is checked?

If you want to force the extension to be shown, it's a persisted preference, so you'd have to do it like:

[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:NO] forKey:@"NSNavLastUserSetHideExtensionButtonState"];
Ken Aspeslagh
Generally speaking, I don't want a file extension, but in some cases, I do. A separate 'export' facility isn't appropriate.
MT