• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: documentClassForType:typeName is dynamic type instead of my declared type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: documentClassForType:typeName is dynamic type instead of my declared type
      • From: Steve Mills <email@hidden>
References: 
 >documentClassForType:typeName is dynamic type instead of my declared type (From: Steve Mills <email@hidden>)

  • Prev by Date: documentClassForType:typeName is dynamic type instead of my declared type
  • Next by Date: Re: documentClassForType:typeName is dynamic type instead of my declared type
  • Previous by thread: documentClassForType:typeName is dynamic type instead of my declared type
  • Next by thread: Re: documentClassForType:typeName is dynamic type instead of my declared type
  • Index(es):
    • Date
    • Thread