Re: Uniform Type Identifiers (UTIs)
Re: Uniform Type Identifiers (UTIs)
- Subject: Re: Uniform Type Identifiers (UTIs)
- From: Steve Christensen <email@hidden>
- Date: Tue, 3 Jan 2006 14:41:33 -0800
On Jan 3, 2006, at 1:48 PM, Philip Dow wrote:
According to the "Introduction to Uniform Type Identifiers
Overview" document: "Support for uniform type identifiers is
available in Mac OS 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 OS 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 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden