How to create package file similar to Logic or Final Cut project

这一生的挚爱 提交于 2019-12-13 03:34:13

问题


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).

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


回答1:


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).

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



来源:https://stackoverflow.com/questions/48892572/how-to-create-package-file-similar-to-logic-or-final-cut-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!