I have a program that exports PDF, TIFF, and PNG files so I followed Apple’s Sketch example when declaring types in my Info.plist file:
CFBundleTypeExtensions
foo
CFBundleTypeName
MyDocumentFileType
CFBundleTypeRole
Editor
NSDocumentClass
MyDocument
NSExportableAs
NSPDFPboardType
NSTIFFPboardType
MyPNGFileType
CFBundleTypeExtensions
pdf
CFBundleTypeName
NSPDFPboardType
CFBundleTypeRole
None
CFBundleTypeExtensions
tiff
tif
CFBundleTypeName
NSTIFFPboardType
CFBundleTypeRole
None
CFBundleTypeExtensions
png
CFBundleTypeName
MyPNGFileType
CFBundleTypeRole
None
Unfortunately, this has an unexpected consequence. Calls to -[NSDocumentController fileExtensionsFromType:] with @”NSPDFPboardType” or @”NSTIFFPboardType” return nil but calling the method with @”MyPNGFileType” still works as expected.
So why is this happening? Thanks!