如何创建类似于Logic或Final Cut项目的打包文件 [英] How to create package file similar to Logic or Final Cut project

查看:416
本文介绍了如何创建类似于Logic或Final Cut项目的打包文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在OS X中创建一个文件,该文件本质上是一个包含文件的包,类似于Logic项目是一个文件,但其中包含所有音频文件的方式(当您右键单击文件,它具有显示包装内容"选项.

I am trying to create a file in OS X that is essentially a package that has files in it, similar to how a Logic project is a single file but contains all of the audio files within it (when you right-click the file it has the "Show Package Contents" option).

在Swift中执行此操作会很棒,但同时也好奇总体上是如何完成的?我运气不太好.

Doing this in Swift would be great, but also curious just in general how this is done? I haven't had much luck.

推荐答案

您需要定义文档包"类型.基本上,这些软件包"只是一个应用了文件扩展名的目录,它告诉macOS将它们显示为软件包.只要在应用程序Info.plist中设置类型,就不需要任何特殊的API来创建程序包(尽管Apple确实有一些帮助程序API,如果要使用它们的话).

You need to define a "Document Package" type. Basically these "packages" are just a directory with a file extension applied that tells macOS to display them as a package. As long as you setup the type in your applications Info.plist then you shouldn't need any special API's to create the packages (though apple does have some helper APIs if you want to use them).

有关定义新的文档包"类型的完整文档以及一些帮助程序API的链接,请参见:

For complete documentation on defining a new "Document Package" type and some links to some helper API's see: https://developer.apple.com/library/content/documentation/CoreFoundation/Conceptual/CFBundles/DocumentPackages/DocumentPackages.html

这篇关于如何创建类似于Logic或Final Cut项目的打包文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆