make mac package/bundle programmatically

后端 未结 4 1993
梦谈多话
梦谈多话 2020-12-09 06:06

through terminal you can make it with a command - \"SetFile -a B filename\"

programmatically i think i should set one of the attributes through [[NSFileManager defa

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 06:22

    You do not set a bundle attribute. You define your document types in your application's Info.plist file, and this is where you specify whether your document's are packages or plain files.

    You can do this from within Xcode by selecting "Get Info" on your application target; switch to the "Properties" tab, then under "Document Types" add a document, give it a Name, set its file extension, choose an Icon file, then check the "Package" checkmark.

提交回复
热议问题