BSD

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Uniform Type Identifiers (UTIs)

    9 answers - 1613 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    According to the "Introduction to Uniform Type Identifiers "
    document: "Support for uniform type identifiers is available in Mac
    S X v10.3 and later."
    According to the "System-Declared Uniform Type Identifiers: document:
    Table 3-1 lists the uniform type identifiers that are declared by the
    system as of Mac S X v10.4.
    I recently upgraded a file importing mechanism in my program to use
    the Uniform Type Identifiers scheme and its associated methods. This
    works beautifully in 10.4, but users running 10.3.9 are encountering
    crashes when importing files. I believe I have tracked it down to the
    UTI references.
    According to bit of documentation, UTIs should work in 10.3.9, but
    according to another bit of documentation, the constants used by the
    UTI implementation such as kUTTypeText or kUTTypeWebArchive are
    available as of 10.4. What's going on here? Am I allowed to use the
    UTI scheme in 10.3.9 as long as I hardcode the UTI definitions, ie
    @"com.apple.webarchive" for kUTTypeWebArchive. The crash log does not
    offer much in the way of usefulness when the app goes down during an
    import, but if I had to guess, it would be because I'm referencing
    symbols that are only included in 10.4 and above.
    Can anyone confirm that hypothesis?
    -Phil
    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com
    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.1 | | 1475 bytes | |

    1/3/06, Philip Dow <dev (AT) phildow (DOT) netwrote:
    According to bit of documentation, UTIs should work in 10.3.9, but
    according to another bit of documentation, the constants used by the
    UTI implementation such as kUTTypeText or kUTTypeWebArchive are
    available as of 10.4. What's going on here? Am I allowed to use the
    UTI scheme in 10.3.9 as long as I hardcode the UTI definitions, ie
    @"com.apple.webarchive" for kUTTypeWebArchive. The crash log does not
    offer much in the way of usefulness when the app goes down during an
    import, but if I had to guess, it would be because I'm referencing
    symbols that are only included in 10.4 and above.

    Can anyone confirm that hypothesis?

    Cross-development support in Xcode and the SDK exist to help detect
    issues like the above. (search ADC for "cross development")

    Anyway looking at the header that defines "kUTTypeWebArchive"
    (UTCoreType.h) I see the following

    extern const CFStringRef kUTTypeWebArchive
    ;

    So you could use cross-development and weak linking to check if that
    is available at run-time and if not use a definition from your own
    binary.
    -Shawn

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.2 | | 2340 bytes | |

    Jan 3, 2006, at 1:48 PM, Philip Dow wrote:

    According to the "Introduction to Uniform Type Identifiers
    " document: "Support for uniform type identifiers is
    available in Mac S X v10.3 and later."

    According to the "System-Declared Uniform Type Identifiers:
    document: Table 3-1 lists the uniform type identifiers that are
    declared by the system as of Mac S X v10.4.

    I recently upgraded a file importing mechanism in my program to use
    the Uniform Type Identifiers scheme and its associated methods.
    This works beautifully in 10.4, but users running 10.3.9 are
    encountering crashes when importing files. I believe I have tracked
    it down to the UTI references.

    According to bit of documentation, UTIs should work in 10.3.9, but
    according to another bit of documentation, the constants used by
    the UTI implementation such as kUTTypeText or kUTTypeWebArchive are
    available as of 10.4. What's going on here? Am I allowed to use the
    UTI scheme in 10.3.9 as long as I hardcode the UTI definitions, ie
    @"com.apple.webarchive" for kUTTypeWebArchive. The crash log does
    not offer much in the way of usefulness when the app goes down
    during an import, but if I had to guess, it would be because I'm
    referencing symbols that are only included in 10.4 and above.

    Can anyone confirm that hypothesis?

    I seem to recall that there was a recent posting, either here or on
    the Carbon list, about this topic. I believe the replier said that
    you would have to provide your own UTI strings for any 10.4+ UTI
    strings if you're running on a pre-10.4 system. You could certainly
    define a class with methods that do the right thing for both cases so
    that callers don't have to know the gory details, something like:

    + (NSString*) getUTTypeWebArchive
    {
    #if MACS_X_VERSIN_MIN_REQUIRED < MACS_X_VERSIN_10_4
    if (kUTTypeWebArchive == NULL)
    return @"com.apple.webarchive";
    #endif

    return (NSString*) kUTTypeWebArchive;
    }

    steve

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.3 | | 3209 bytes | |

    Thanks Shawn and Steve. I thought it might have to do with the web
    archive uti if not the uti constants in general. I'm already weak
    linking my app and checking for 10.4 before calling other methods, so
    I should be able to slide this in without too much difficulty.
    -Phil

    Jan 3, 2006, at 11:41 PM, Steve Christensen wrote:

    Jan 3, 2006, at 1:48 PM, Philip Dow wrote:
    >
    >According to the "Introduction to Uniform Type Identifiers
    >" document: "Support for uniform type identifiers is
    >available in Mac S X v10.3 and later."
    >>

    >According to the "System-Declared Uniform Type Identifiers:
    >document: Table 3-1 lists the uniform type identifiers that are
    >declared by the system as of Mac S X v10.4.
    >>

    >I recently upgraded a file importing mechanism in my program to
    >use the Uniform Type Identifiers scheme and its associated
    >methods. This works beautifully in 10.4, but users running 10.3.9
    >are encountering crashes when importing files. I believe I have
    >tracked it down to the UTI references.
    >>

    >According to bit of documentation, UTIs should work in 10.3.9, but
    >according to another bit of documentation, the constants used by
    >the UTI implementation such as kUTTypeText or kUTTypeWebArchive
    >are available as of 10.4. What's going on here? Am I allowed to
    >use the UTI scheme in 10.3.9 as long as I hardcode the UTI
    >definitions, ie @"com.apple.webarchive" for kUTTypeWebArchive. The
    >crash log does not offer much in the way of usefulness when the
    >app goes down during an import, but if I had to guess, it would be
    >because I'm referencing symbols that are only included in 10.4 and
    >above.
    >>

    >Can anyone confirm that hypothesis?
    >

    I seem to recall that there was a recent posting, either here or on
    the Carbon list, about this topic. I believe the replier said that
    you would have to provide your own UTI strings for any 10.4+ UTI
    strings if you're running on a pre-10.4 system. You could certainly
    define a class with methods that do the right thing for both cases
    so that callers don't have to know the gory details, something like:

    + (NSString*) getUTTypeWebArchive
    {
    #if MACS_X_VERSIN_MIN_REQUIRED < MACS_X_VERSIN_10_4
    if (kUTTypeWebArchive == NULL)
    return @"com.apple.webarchive";
    #endif

    return (NSString*) kUTTypeWebArchive;
    }
    --
    steve

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40phildow.net

    This email sent to dev (AT) phildow (DOT) net

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.4 | | 1722 bytes | |

    1/3/06, Philip Dow <dev (AT) phildow (DOT) netwrote:
    According to bit of documentation, UTIs should work in 10.3.9, but
    according to another bit of documentation, the constants used by the
    UTI implementation such as kUTTypeText or kUTTypeWebArchive are
    available as of 10.4. What's going on here? Am I allowed to use the
    UTI scheme in 10.3.9 as long as I hardcode the UTI definitions, ie
    @"com.apple.webarchive" for kUTTypeWebArchive. The crash log does not
    offer much in the way of usefulness when the app goes down during an
    import, but if I had to guess, it would be because I'm referencing
    symbols that are only included in 10.4 and above.

    Can anyone confirm that hypothesis?

    Cross-development support in Xcode and the SDK exist to help detect
    issues like the above. (search ADC for "cross development")

    Anyway looking at the header that defines "kUTTypeWebArchive"
    (UTCoreType.h) I see the following

    extern const CFStringRef kUTTypeWebArchive
    ;

    So you could use cross-development and weak linking to check if that
    is available at run-time and if not use a definition from your own
    binary.
    -Shawn

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40mac.com

    This email sent to bluegus (AT) mac (DOT) com

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.5 | | 2451 bytes | |

    As a follow up

    I am noticing that the UTI scheme does not always identify the super
    type of a file. I have users trying to import regular text files
    identified by extensions such as .en but the method UTTypeConformsTo
    does not return true when checking this file against
    kUTTypePlainText. Is there an easy way for a user to set the file
    type of a file or many files without changing the extension. In the
    Finder, you can choose get info to change the associated application.
    Is there something like that for file type?
    -Phil

    Jan 4, 2006, at 1:48 AM, August Trometer wrote:

    1/3/06, Philip Dow <dev (AT) phildow (DOT) netwrote:
    >According to bit of documentation, UTIs should work in 10.3.9, but
    >according to another bit of documentation, the constants used by the
    >UTI implementation such as kUTTypeText or kUTTypeWebArchive are
    >available as of 10.4. What's going on here? Am I allowed to use the
    >UTI scheme in 10.3.9 as long as I hardcode the UTI definitions, ie
    >@"com.apple.webarchive" for kUTTypeWebArchive. The crash log does not
    >offer much in the way of usefulness when the app goes down during an
    >import, but if I had to guess, it would be because I'm referencing
    >symbols that are only included in 10.4 and above.
    >>

    >Can anyone confirm that hypothesis?
    >

    Cross-development support in Xcode and the SDK exist to help detect
    issues like the above. (search ADC for "cross development")
    --
    Anyway looking at the header that defines "kUTTypeWebArchive"
    (UTCoreType.h) I see the following

    extern const CFStringRef kUTTypeWebArchive
    ;

    So you could use cross-development and weak linking to check if that
    is available at run-time and if not use a definition from your own
    binary.

    -Shawn

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40mac.com

    This email sent to bluegus (AT) mac (DOT) com

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.6 | | 998 bytes | |

    Jan 4, 2006, at 3:57 AM, Philip Dow wrote:

    As a follow up

    I am noticing that the UTI scheme does not always identify the
    super type of a file. I have users trying to import regular text
    files identified by extensions such as .en but the method
    UTTypeConformsTo does not return true when checking this file
    against kUTTypePlainText. Is there an easy way for a user to set
    the file type of a file or many files without changing the extension.

    I don't think there is any easy way for a *user* (without additional
    tools) to do this. An application or the system has to export a UTI
    which says .en is text, or the file has to have an HFS type of 'TEXT'.

    Jim

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.7 | | 668 bytes | |

    Jan 3, 2006, at 2:44 PM, Philip Dow wrote:

    Thanks Shawn and Steve. I thought it might have to do with the web
    archive uti if not the uti constants in general. I'm already weak
    linking my app and checking for 10.4 before calling other methods

    In general you shouldn't need to check for 10.4 just if the symbol
    you want to use exists (non-null).
    -Shawn

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.8 | | 1226 bytes | |

    I'm using 10.4 features all over the app within a variety of objects
    while continuing compatibility with 10.3.9. To accomplish this,
    rather than check for the existence of a 10.4 specific symbol
    whenever I need it, I check NSAppKitVersionNumber as my main
    controller inits and then set a user default bool depending on the
    value. I've done that, the bool value is available from anywhere
    with minimal hassle.
    -Phil

    Jan 4, 2006, at 12:01 AM, Shawn Erickson wrote:

    Jan 3, 2006, at 2:44 PM, Philip Dow wrote:
    >
    >Thanks Shawn and Steve. I thought it might have to do with the web
    >archive uti if not the uti constants in general. I'm already weak
    >linking my app and checking for 10.4 before calling other methods
    >

    In general you shouldn't need to check for 10.4 just if the symbol
    you want to use exists (non-null).

    -Shawn

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com
  • No.9 | | 2147 bytes | |

    Jan 4, 2006, at 8:33 AM, Philip Dow wrote:

    Jan 4, 2006, at 12:01 AM, Shawn Erickson wrote:
    >
    >Jan 3, 2006, at 2:44 PM, Philip Dow wrote:
    >>

    Thanks Shawn and Steve. I thought it might have to do with the
    web archive uti if not the uti constants in general. I'm already
    weak linking my app and checking for 10.4 before calling other
    methods
    >>

    >In general you shouldn't need to check for 10.4 just if the symbol
    >you want to use exists (non-null).
    >

    I'm using 10.4 features all over the app within a variety of
    objects while continuing compatibility with 10.3.9. To accomplish
    this, rather than check for the existence of a 10.4 specific symbol
    whenever I need it, I check NSAppKitVersionNumber as my main
    controller inits and then set a user default bool depending on the
    value. I've done that, the bool value is available from
    anywhere with minimal hassle.

    You're having to do a runtime check in either case so having a
    special boolean doesn't really buy you anything. With a boolean (or
    even saving the value returned by NSAppKitVersionNumber), you have to
    keep track of the first S version where a symbol becomes available;
    checking for the existence of a particular symbol lets you
    automatically handle the case where, say, a symbol becomes available
    in 10.4.3 but wasn't available in 10.4.

    Also, wrapping these specifics in a few class methods or routines
    means that the S version details are also limited to a few specific
    places, rather than scattered all over your code. Bug fixes happen in
    the one instance of a wrapper and are automatically available to all
    callers.

    steve

    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list (Cocoa-dev (AT) lists (DOT) apple.com)
    Help/Unsubscribe/Update your Subscription:
    %40developershed.com

    This email sent to bsdarchive (AT) developershed (DOT) com

Re: Uniform Type Identifiers (UTIs)


max 4000 letters.
Your nickname that display:
In order to stop the spam: 9 + 8 =
QUESTION ON "BSD"

EMSDN.COM