【发布时间】:2016-03-05 07:13:21
【问题描述】:
我们基于 UIDocument 的应用程序在 info.plist 的“Exported Type UTI”和“Document types”下定义了一个自定义文档类型。根据 Apple 文档,我们正在 iCloud 通用容器中创建 UIDocuments。在设备重新启动之前,这些文档不会被注册为一个包。这只发生在第一次安装应用程序时。重新启动后,创建的任何新文档都将被视为我们自定义类型的包(应该如此)。
Info.plist 有以下条目:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>Sample Doc</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.sampledoc.tst</string>
</array>
<key>LSTypeIsPackage</key>
<true/>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>com.apple.package</string>
</array>
<key>UTTypeDescription</key>
<string>Sample Doc</string>
<key>UTTypeIdentifier</key>
<string>com.sampledoc.tst</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>tst</string>
</array>
</dict>
</dict>
</array>
当元数据查询返回结果时,contentType 将为“dyn”。 (这是问题所在)。设备重启后,新文档的 contentType 将为 com.sampledoc.tst(这是预期值)。
还有其他人遇到过这个问题吗?任何帮助将不胜感激。
【问题讨论】:
标签: ios icloud uidocument