Re: Uniform Type Identifiers (UTIs)
Re: Uniform Type Identifiers (UTIs)
- Subject: Re: Uniform Type Identifiers (UTIs)
- From: Philip Dow <email@hidden>
- Date: Tue, 3 Jan 2006 23:44:12 +0100
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
On Jan 3, 2006, at 11:41 PM, Steve Christensen wrote:
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
_______________________________________________
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