• 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
Leopard: fileExtensionsFromType: deprecation breaks saving with extension
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Leopard: fileExtensionsFromType: deprecation breaks saving with extension


  • Subject: Leopard: fileExtensionsFromType: deprecation breaks saving with extension
  • From: Fritz Anderson <email@hidden>
  • Date: Fri, 9 Nov 2007 14:44:24 -0600

My problem seems to entangle Cocoa and Xcode, but I'm trying this list first.

I am running Xcode 3.0 on Leopard.

When I try to save my application's document, the document does not get the proper extension. An extensive diagnostic (below) appears in the debugger console. The document, including type, UTI, and extension, is declared properly in the Properties tab of the Target Info. (Or at least, properly as of Tiger, and to the full extent that window permits.)

I also cannot open old documents that had the correct extension. (Yes, saving worked before, and I can't determine what went wrong.)

My question, in brief, is: How do I get the behavior I believe I am specifying?

	— F


The document class implements dataOfType:error: .

Here is the doc-type list from my application's Info.plist file:

==============
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeExtensions</key>
            <array>
                <string>myappfile</string>
            </array>
            <key>CFBundleTypeIconFile</key>
            <string></string>
            <key>CFBundleTypeName</key>
            <string>MyApp Data File</string>
            <key>CFBundleTypeOSTypes</key>
            <array>
                <string>mypF</string>
            </array>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>org.manoverboard.myapp.file</string>
            </array>
            <key>NSDocumentClass</key>
            <string>MyDocument</string>
        </dict>
    </array>
==============

When I try to save my application's document, the console fills with

==============
-[NSDocumentController fileExtensionsFromType:] is deprecated, and does not work when passed a uniform type identifier (UTI). If the application didn't invoke it directly then the problem is probably that some other NSDocument or NSDocumentController method is getting confused by a UTI that's not actually declared anywhere. Maybe it should be declared in the UTExportedTypeDeclarations section of this app's Info.plist but is not. The alleged UTI in question is "org.manoverboard.myapp.file".
==============


So I have "a UTI that's not actually declared anywhere?" I declare it as a document attribute in Info.plist, and had not thought it necessary to declare it elsewhere.

My UTI string appears nowhere but in the document declaration in Info.plist. I don't send fileExtensionsFromType: .

The message says I should declare my UTI in UTExportedTypeDeclarations. But Xcode does not provide a UI for creating or editing that list.

I'm using this project as a teaching example. Please tell me I don't have to tell my pupils to hand-edit Info.plist.

I am out of ideas.

How can I avoid this diagnostic, and get the extension declared for this document type (and UTI)?

_______________________________________________

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: Leopard: fileExtensionsFromType: deprecation breaks saving with extension
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: Re: SenTestingKit fails when using CG-Only
  • Next by Date: Re: Leopard: fileExtensionsFromType: deprecation breaks saving with extension
  • Previous by thread: spoofing NSEvents vs. abstracting out non-coalesced mouse dragged events
  • Next by thread: Re: Leopard: fileExtensionsFromType: deprecation breaks saving with extension
  • Index(es):
    • Date
    • Thread