Finder 无法识别自定义 UTI
我试图为我的非基于文档的应用程序创建自定义 UTI。 我已经阅读了苹果文档和几个SO问题,但似乎没有一个能解决我的问题。
我在 XCode 4 中创建了一个新的 UTI(“目标”-->“导出的 UTI”),其中我以反向 DNS 顺序设置了标识符、简短描述和系统或任何人不使用的自定义文件扩展名别的。
不幸的是,Finder 似乎无法识别 UTI,这意味着当我手动将文件与应用程序关联时,它不会显示图标,也不会显示说明。
我需要做其他事情才能使这项工作成功吗? 实际上,我只是以二进制格式保存这些文件,并在路径末尾附加自定义文件扩展名。 手动与应用程序关联时,双击“.vsplf”文件会成功打开应用程序并从文件加载设置。
任何想法都受到高度赞赏!
I was trying to create a custom UTI for my non-document-based application.
I have already been reading the Apple documents and several SO questions, but none seems to be addressing my issue.
I created a new UTI in XCode 4 ( "Target" --> "Exported UTIs" ), where I set the identifier in a reverse DNS order, a short description and a custom file extension that is not used by the system or anyone else.
Unfortunately, Finder does not seem to recognize the UTI, meaning that it is not showing the icon and is not showing the description when I associate the file with my application manually.
Do I have to do something else to make this work?
I am actually just saving these files in a binary format and attaching the custom file extension at the end of the path.
When associated with the application manually, double-clicking a ".vsplf" file results in successfully opening the application and loading the settings from the file.
Any ideas are highly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅仅声明 UTI 是不够的。您还需要在 Info.plist 中创建一个
Document Type
条目。这里有一个很好的屏幕截图解释:
如何注册自定义非文档 UTI/文件类型以便 OSX 识别它?
Declaring the UTI is not sufficient. You also need to create a
Document Type
entry in your Info.plist.There is a good explanation with screenshots here:
How to register a custom non-document UTI / file type for OSX to recognize it?