How do you get the list of all supported document types in a Cocoa app, programatically?
I expected to find this in NSDocumentController
but the closest thing appears to be documentClassNames
, a list of NSDocument
subclasses.
EDIT 1:
If you open Project.-Info.plist then there you can find Document types.
And this is written is a plist (key-value pairs) you can simply get those values.
NSDictionary *infoDict=[[NSBundle mainBundle] infoDictionary];
NSArray *extensions=[infoDict valueForKeyPath:@"CFBundleDocumentTypes.CFBundleTypeExtensions"];
NSLog(@"ext:%@",extensions);