I have written an editor that I would like to be able to handle any file, including those with no extension.
I think that I need to add **** to the Document OS Types in my filetype entry in the Info.plist, but whereas this does allow me to drag any file to the dock icon, it doesn’t attempt to open the file with the associated NSDocument class, instead telling me that my application doesn’t know how to open the “SimpleText Format” format.
Any help with the step I have missed here would be greatly appreciated.
You need to implement a custom
NSDocumentControllersubclass and override thetypeForContentsOfURL:error:method, returning the name of a document type, specified byCFBundleTypeNamein the application’sInfo.plistfileIn order to make the application use your custom
NSDocumentController, just drag a generic object into yourMainMenu.xibfile and assign it your document controller’s class. The document architecture will then automatically use your document controller subclass instead of a genericNSDocumentController.