0

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

1 Answer 1

1

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"];
1
  • Generally speaking, I don't want a file extension, but in some cases, I do. A separate 'export' facility isn't appropriate.
    – MT.
    Commented Nov 29, 2009 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.