• 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: Using Xcode's target=>info=>Document Types panel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Xcode's target=>info=>Document Types panel


  • Subject: Re: Using Xcode's target=>info=>Document Types panel
  • From: Jean Suisse <email@hidden>
  • Date: Mon, 12 Nov 2012 18:20:23 +0100

On 12 nov. 2012, at 01:22, Jerry Krinock wrote:

Probably you're filling out the correctly, but there may be more to do.

On thing I didn't do is to wait a few minutes after moving the app in the Applications folder so that launch service can update its database. I was constantly changing parameters, rebuilding, trying, etc.

• First, inspect the Info.plist file in your products's 'Contents' and make sure that the values in CFBundleDocumentTypes and UTExportedTypeDeclarations reflect your latest changes.  (The keys I give here are the actual keys you'll see in a text editor, or in Plist Edit Pro with Definitions set to "None".  I like to look at plist's "bare metal".)

I checked. They do.


• If you have built and run your app with the *wrong* information in Info.plist, your launch services database may be confused  This happened to me a couple days ago.  (Of course, if this is the problem your app will work OK on another Mac account.)  

Well, now, it does work (almost) OK on an other account.

Things that work:
- The app is the default editor.
- The description string for the file type correctly displays in the finder

Things that don't work:
- The icon displayed for the file type is generic and does not match the one I specified.
- Quicklook doesn't generate a preview for my file.

Anyhow, make sure all builds of your app with bogus Info.plist have been deleted.  Search the 'LSHandlers' in ~/Library/Preferences/com.apple.LaunchServices.plist for any entries referencing your app's document extension *or* bundle identifier.  Look for duplicate, conflicting entries in particular.  If you find anything wrong, fix it.  Carefully, of course because your Mac needs this file to work properly.  Then re-load it by running this command:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

Thanks for the tip. This is really useful.

More info:
Here is my plist (ext stands for the file extension. DESCRIPTION is the string describing the file type):

<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ext</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>file_icon</string>
<key>CFBundleTypeName</key>
<string>DESCRIPTION</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>app.identifier.ext</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSExportableAs</key>
<array/>
</dict>
</array>




<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.plain-text</string>
</array>
<key>UTTypeDescription</key>
<string>DESCRIPTION</string>
<key>UTTypeIconFile</key>
<string>file_icon</string>
<key>UTTypeIconName</key>
<string>file_icon</string>
<key>UTTypeIdentifier</key>
<string>app.identifier.ext</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>ext</string>
</array>
</dict>
</dict>
</array>



On 12 nov. 2012, at 01:22, Jerry Krinock <email@hidden> wrote:




On 2012 Nov 11, at 12:55, Jean Suisse <email@hidden> wrote:

Well, I seemed to have worked just once, for one file extension, but I did some modifications to inform quick look that it could display my files as text files.  As a result, it doesn't work anymore, and I can't make it work again.

Probably you're filling out the correctly, but there may be more to do.

• First, inspect the Info.plist file in your products's 'Contents' and make sure that the values in CFBundleDocumentTypes and UTExportedTypeDeclarations reflect your latest changes.  (The keys I give here are the actual keys you'll see in a text editor, or in Plist Edit Pro with Definitions set to "None".  I like to look at plist's "bare metal".)

• If you have built and run your app with the *wrong* information in Info.plist, your launch services database may be confused  This happened to me a couple days ago.  (Of course, if this is the problem your app will work OK on another Mac account.)  Anyhow, make sure all builds of your app with bogus Info.plist have been deleted.  Search the 'LSHandlers' in ~/Library/Preferences/com.apple.LaunchServices.plist for any entries referencing your app's document extension *or* bundle identifier.  Look for duplicate, conflicting entries in particular.  If you find anything wrong, fix it.  Carefully, of course because your Mac needs this file to work properly.  Then re-load it by running this command:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using Xcode's target=>info=>Document Types panel
      • From: Jerry Krinock <email@hidden>
References: 
 >Using Xcode's target=>info=>Document Types panel (From: Jean Suisse <email@hidden>)

  • Prev by Date: Re: IB Deployment
  • Next by Date: Re: Using Xcode's target=>info=>Document Types panel
  • Previous by thread: Using Xcode's target=>info=>Document Types panel
  • Next by thread: Re: Using Xcode's target=>info=>Document Types panel
  • Index(es):
    • Date
    • Thread