自定义类型本来应该在Info.plist中声明和导出的,但是没有找到 背景:问题

问题描述

背景:

我制作了一个自定义类,用作 NSItemProvider 以在我的应用中实现拖放功能

writableTypeIdentifiersForItemProviderreadableTypeIdentifiersForItemProvider 包含一个类型,我创建的自定义 UTType 专门引用此类类 - sectionFormat

extension UTType {
    public static let sectionFormat = UTType(exportedAs: "com.noah.sectionFormat")
}

问题

我收到以下错误

[Type Declaration Issues] Type "com.noah.sectionFormat" was expected to be declared and exported in the Info.plist of Noah.app,but it was not found.

我尝试通过在源代码末尾添加以下内容在 info.plist 中进行设置:

//...

    <key>UTExportedTypeDeclarations</key>
        <array>
            <key>UTTypeIdentifier</key>
            <string>com.noah.sectionFormat</string>
        </array>
</dict>
</plist>

但是错误仍然存​​在。我做错了什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)