UTI 唯一类型标识

 

本文转载至 http://blog.csdn.net/zaitianaoxiang/article/details/6657231

 

Adopting Uniform Type Identifiers采用统一类型标识符
Introduction to Uniform Type Identifiers Overview 统一类型标示符概述
Declaring New Uniform Type Identifiers声明新的统一类型标示符

From the documentation:

If your application uses proprietary data formats, you should declare them in the Info.plist file of your application bundle. Some guidelines:

  • Your UTI string must be unique. Following the reverse-DNS format beginning with com.companyName is a simple way to ensure uniqueness. While the system can support different UTI strings with the same specification, the reverse is not true.

  • If your code relies on third-party UTI types that may not be present on the system, you should declare those UTIs as imported types in your bundle.

  • Be sure to add conformance information if your proprietary type is a subtype of one or more existing types. In most cases you should not specify conformance to a nonpublic type, unless you are also declaring that type in your bundle. For a list of public and Apple-defined UTIs, see "System-Declared Uniform Type Identifiers"

如果你的应用程序用到专用的数据类型,你需要声明他们在你的应用程序绑定的info.plist文件。

一些提示:

      你定义的统一类型标识 必须是特定的,随着com.companyName反向DNS格式开始一个简单的方法,以确保唯一虽然该系统可以支持不同UTI的字符串按照同样的规格反之则不行

      如果你的代码依赖第三方UTI但是可能不存在于系统中你应该声明UTI绑定的导入类型

      如果您的专有类型一个或多个现有类型一个子型,则必须要添加一致性信息在大多数情况下你不应该非公有制类型指定一致性除非你也声明了此种类型的bundle中。

      对于公众苹果定义的UTI列表,请参见System-Declared Uniform Type Identifiers

原文地址:https://www.cnblogs.com/Camier-myNiuer/p/3601794.html