I'm writing a document-based Mac application that can open any type. My application receives dropped files of any type on its Dock tile successfully, but when I choose Open from the File menu, all files are grayed out.
It's the standard Open item that comes with the template; I haven't put anything special behind it.
Here's the relevant part of my Info.plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFile</key>
<string></string>
<key>CFBundleTypeName</key>
<string>Any file</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSDocumentClass</key>
<string>MyDocument</string>
</dict>
</array>
I have a custom document controller; here's its implementation.
- (Class) documentClassForType:(NSString *)documentTypeName {
return [MyDocument class];
}
- (NSString *) typeForContentsOfURL:(NSURL *)inAbsoluteURL error:(NSError **)outError {
return @"Any file";
}
These methods are not called at any time unless I drop a file on the Dock tile.