UTI's identify data. It's not just files; streaming data, cut-and-paste data, a disk volume - if it exists, it can have a UTI type. Obviously this is much more powerful than identifying things by extensions or by magic numbers. Identifying data helps applications know what helper applications they may use and also let them know when their own abilities are enough (if a .html file is a subset of text, then any text app can handle it)
My immediate reaction was to think "Mime?". Mime types aren't the answer, at least in Apple's opinion. It starts off in the right direction, but only has a two level hierarchy and requires approval by the IANA for extensions other than "x-". Apple proposes a more extensible format where it has provided top-level identifiers such as public.text, public.plain-text, etc. If you want to define a type, you don't need Apple: "com.yourdomain.yourtype" is how you do it. In your app's Info.plist, you declare that and say what UTI's it inherits from. See https://developer.apple.com/documentation/Carbon/Conceptual/understanding_utis/ for more details.
https://arstechnica.com/reviews/os/macosx-10.4.ars/11 has a nice overview of all this also.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2009-11-07 Tony Lawrence