将文档类型添加到 Mac OS X 项目
我的 Mac 应用程序不是基于文档的应用程序。这意味着您只能打开一个窗口,并且您不会注意到数据已保存到库中的文件中。
但现在我想导入和导出数据。
我发现这并不难,而且导入和导出效果很好。
但是:还不够好。当您在查找器中看到导出的文件时,您会将其视为未知文件。如果您尝试打开它,您会收到消息说没有应用程序,甚至我的应用程序都无法打开它。您必须在应用程序中单击“导入”。
我希望您可以看到该文件是我的申请的一部分。
如果您单击它,应用程序应该会出现并询问您是否要导入。我用谷歌搜索了它并搜索了偏好设置,但我没有找到任何东西。你能帮助我吗?
My Mac application is not a document based application. That means you can have only one window open and you do not notice the saving of the data to a file in the library.
But now I want to import and export data.
I found it was not that hard, and the importing and exporting works well.
BUT: Not good enough. When you see the exported file in finder, you see it as an unknown file. And if you try to open it, you get the message that no application, not even my app can open it. You have to click "Import" In the App.
I want that you can see the file being part of my Application.
And if you click it, the application should show up and ask you if you want to import. I googled for it and I searched the preferences, but I did not find anything. Can you help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将 UTI 添加到您的 info.plist 文件中,以便当您双击应用程序类型的文件时,Finder 知道要打开哪个应用程序。
我找到了这个教程。我认为这不一定是 NSDocument 特定的。
http://mobiforge.com/developing/story/importing-exporting-documents-ios
You need to add a UTI to your info.plist file so the Finder knows which app to open when you double click a file of your app's type.
I found this tutorial. I don't think it's necessarily NSDocument specific.
http://mobiforge.com/developing/story/importing-exporting-documents-ios