iOS - UTI
一、UTI概念
?
1、什么是UTI
?
Uniform Type Identifier,是字符串,格式標(biāo)識(shí)符。
根據(jù)UTI,可得到相應(yīng)的其他類型的格式標(biāo)識(shí)符。比如public.jpeg對應(yīng)于:
?
- A four-character file type code (an OSType) of 'JPEG'
- A filename extension of .jpg
- A filename extension of .jpeg
- A MIME type of image/jpeg
?
2、可包含的字符集
?
可包含字符:字母,數(shù)字,點(diǎn)號(hào),連字符。
?
3、UTI句法
?
反域名語法
?
- com.apple.quicktime-movie
- com.mycompany.myapp.myspecialfiletype
- public.html
- com.apple.pict
- public.jpeg
?
4、繼承
?
UTI與其他格式標(biāo)識(shí)符的特點(diǎn)是可繼承。比如 public.html 繼承自 public.text ,聲明可以打開 public.text 的應(yīng)用同樣可以打開 public.html。
支持多繼承。比如 com.apple.application-package 繼承自 com.apple.bundle 和 com.apple.package。
UTI可以說明物理和邏輯上兩方面的類型。物理上分為文件夾、文件等類型;邏輯上分為圖片、音頻等類型。
?
5、Identifier Tags
?
每個(gè)UTI都可以有任意個(gè)Identifier Tags,這些Identifier Tags是UTI的等價(jià)替代物,比如filename extension, MIME type, or NSPasteboard type。
?
二、UTI相關(guān)函數(shù)
?
定義在MobileCoreServices庫的UTType.h中
?
三、聲明新的UTI
?
?
然后你就可以使用com.kingreader.umd標(biāo)識(shí)符了~
蘋果文檔:
https://developer.apple.com/library/prerelease/watchos/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_intro/understand_utis_intro.html#//apple_ref/doc/uid/TP40001319-CH201-SW1
轉(zhuǎn)載于:https://www.cnblogs.com/tangjuanj/p/6015794.html
總結(jié)
- 上一篇: ubuntu下集群设置静态ip
- 下一篇: 视频消重伪原创有用吗 视频md5修改器最