How to make Cocoa document package type with it's extension hidden by default?
问题 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? 回答1: You can use the -setAttributes:ofItemAtPath:error: method of NSFileManager to set the file attributes of any file. In this case you want to set the value of the