Problem with Info.plist in 10.5

  • Hi,

    I'm writing a Leopard-target application. Therefore I'm willing to use
    UTI and the new-style for the Info.plist. I red the AppKit release
    notes and I thought I didn't forget something. But when I'm calling
    the save panel I get this error message on the console:

    2008-08-27 14:12:52.522 MyApp[23412:813] An NSDocumentController
    returned nil when sent -displayNameForType:@"ch.ftestuz.MyApp.rgbd".
    See the info about new support for UTIs in the Leopard AppKit release
    notes.
    2008-08-27 14:12:52.523 MyApp[23412:813] An NSDocumentController
    returned nil when sent -displayNameForType:@"ch.ftestuz.MyApp.rgbdx".
    See the info about new support for UTIs in the Leopard AppKit release
    notes.

    My Info.plist is below. I know I can delete some keys, may this be the
    source of the problems?

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd
    ">
    <plist version="1.0">
    <dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>fr_CH</string>
    <key>CFBundleDisplayName</key>
    <string></string>
    <key>CFBundleDocumentTypes</key>
    <array>
      <dict>
      <key>CFBundleTypeExtensions</key>
      <array>
        <string>rgbd</string>
      </array>
      <key>CFBundleTypeMIMETypes</key>
      <array>
        <string>application/octet-stream</string>
      </array>
      <key>CFBundleTypeName</key>
      <string>MyApp SQLite</string>
      <key>CFBundleTypeOSTypes</key>
      <array>
        <string>RgBD</string>
      </array>
      <key>CFBundleTypeRole</key>
      <string>Editor</string>
      <key>LSItemContentTypes</key>
      <array>
        <string>ch.ftestuz.MyApp.rgbd</string>
      </array>
      <key>LSTypeIsPackage</key>
      <false/>
      <key>NSDocumentClass</key>
      <string>RBDDocument</string>
      <key>NSPersistentStoreTypeKey</key>
      <string>SQLite</string>
      </dict>
      <dict>
      <key>CFBundleTypeExtensions</key>
      <array>
        <string>rgbdx</string>
      </array>
      <key>CFBundleTypeMIMETypes</key>
      <array>
        <string>text/xml</string>
      </array>
      <key>CFBundleTypeName</key>
      <string>XML</string>
      <key>CFBundleTypeOSTypes</key>
      <array>
        <string>RgBX</string>
      </array>
      <key>CFBundleTypeRole</key>
      <string>Editor</string>
      <key>LSItemContentTypes</key>
      <array>
        <string>ch.ftestuz.MyApp.rgbdx</string>
      </array>
      <key>LSTypeIsPackage</key>
      <false/>
      <key>NSDocumentClass</key>
      <string>RBDDocument</string>
      <key>NSPersistentStoreTypeKey</key>
      <string>XML</string>
      </dict>
    </array>
    <key>CFBundleExecutable</key>
    <string>MyApp</string>
    <key>CFBundleIdentifier</key>
    <string>ch.ftestuz.MyApp</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>MyApp</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>0.1</string>
    <key>CFBundleSignature</key>
    <string>RgBD</string>
    <key>CFBundleVersion</key>
    <string>0.1</string>
    <key>NSMainNibFile</key>
    <string>MainMenu</string>
    <key>NSPrincipalClass</key>
    <string>NSApplication</string>
    <key>UTExportedTypeDeclarations</key>
    <array>
      <dict>
      <key>UTTypeConformsTo</key>
      <array>
        <string>public.content</string>
        <string>public.data</string>
      </array>
      <key>UTTypeDescription</key>
      <string>MyApp document</string>
      <key>UTTypeIdentifier</key>
      <string>ch.ftestuz.MyApp.rgbd</string>
      <key>UTTypeTagSpecification</key>
      <dict>
        <key>com.apple.ostype</key>
        <string>RgBD</string>
        <key>public.filename-extension</key>
        <string>rgbd</string>
        <key>public.mime-type</key>
        <string>application/octet-stream</string>
      </dict>
      </dict>
      <dict>
      <key>UTTypeConformsTo</key>
      <array>
        <string>public.xml-file</string>
      </array>
      <key>UTTypeDescription</key>
      <string>MyApp XML document</string>
      <key>UTTypeIdentifier</key>
      <string>ch.ftestuz.MyApp.rgbdx</string>
      <key>UTTypeTagSpecification</key>
      <dict>
        <key>com.apple.ostype</key>
        <string>RgBX</string>
        <key>public.filename-extension</key>
        <string>rgbdx</string>
        <key>public.mime-type</key>
        <string>text/xml</string>
      </dict>
      </dict>
    </array>
    </dict>
    </plist>

    Anyone can give me a little help? Or show me an example with just the
    keys required by Leopard?

    Thank you.

    Frédéric
  • Le 27 août 08 à 21:14, Frédéric Testuz a écrit :

    > Hi,
    >
    > I'm writing a Leopard-target application. Therefore I'm willing to
    > use UTI and the new-style for the Info.plist. I red the AppKit
    > release notes and I thought I didn't forget something. But when I'm
    > calling the save panel I get this error message on the console:
    >
    > 2008-08-27 14:12:52.522 MyApp[23412:813] An NSDocumentController
    > returned nil when sent -displayNameForType:@"ch.ftestuz.MyApp.rgbd".
    > See the info about new support for UTIs in the Leopard AppKit
    > release notes.
    > 2008-08-27 14:12:52.523 MyApp[23412:813] An NSDocumentController
    > returned nil when sent -
    > displayNameForType:@"ch.ftestuz.MyApp.rgbdx". See the info about new
    > support for UTIs in the Leopard AppKit release notes.

    I resolved the problem. I'm not exactly sure about what cause the
    resolution. I took the Info.plist of the Sketch exemple, changed it's
    data with mine. Rebuild and launched the app. At this time, the
    problem was not resolved.

    Then I deleted all the keys which are obsolete in 10.5, rebuild and
    launched the app. And the problem was resolved.

    I don't know if the Info.plist parser is too sensible with mix of 10.4
    and 10.5 infos. It can also be that the new infos was not immediately
    take into account by the system (LaunchService I think?).

    Frédéric