Re: documentClassForType:typeName is dynamic type instead of my declared type
Re: documentClassForType:typeName is dynamic type instead of my declared type
- Subject: Re: documentClassForType:typeName is dynamic type instead of my declared type
- From: Quincey Morris <email@hidden>
- Date: Tue, 03 Feb 2015 20:49:43 +0000
On Feb 3, 2015, at 12:07 , Steve Mills <email@hidden> wrote:
>
> (The main type is a package, if that matters.) The Save dialog correctly shows my type at the top of the Type popup, it saves it with the correct extension, and Finder shows that it's a package, not a folder. But when I drag & drop the file to my app, the type given to documentClassForType: is dyn.ah62d4qmuhk2x44pdra instead of my UTI.
> <key>UTTypeConformsTo</key>
> <array>
> <string>public.data</string>
> </array>
The ‘dyn’ UTI means that something (presumably a .chest extension in this case) was converted to a UTI, but that no known UTI was capable of “claiming” it, so a new temporary one was created.
My guess is that it’s for one of two reasons:
1. Because this is a package, the UTI must be declared to conform to com.apple.package, not public.data. (According to https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html <https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html>, the “LMTypeIsPackage” key is ignored when a ”LSItemContentTypes” key is present. The list of sub-keys under ‘CFBundleDocumentTypes’, also says which other keys are ignored in this case, such as CFBundleTypeExtensions.)
So, right extension, wrong structure, and LS couldn’t figure out what you meant.
There’s a document somewhere that says how to configure a file type properly as a package and a non-package, but I can’t find it now. Non-packages should conform to public.content *and* public.data, IIRC, FWIW.
2. Because there’s an older, out of date app bundle on your system somewhere, and Launch Services is using that as its definitive source of information.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden