I’m making a Cocoa application which uses document package (bundle) as it’s data.
I specified an extension and Finder now recognizes the folder with the extension as a document well.
But the folder’s extension is still displaying, and I want to hide it by default (like application bundle) Is there an option to do this?
I’m making a Cocoa application which uses document package (bundle) as it’s data. I
Share
You can use the
-setAttributes:ofItemAtPath:error:method ofNSFileManagerto set the file attributes of any file. In this case you want to set the value of theNSFileExtensionHiddenkey.To apply this to your saved document, you can override
-writeToURL:ofType:error:in yourNSDocumentsubclass and then set the file extension to hidden once the document is saved: