How do I access images (for document icons) in an asset catalog in the Xcode 5 product preference editor

后端 未结 4 789
忘了有多久
忘了有多久 2021-02-07 06:57

I think I\'m literally on the last step before submitting a new Mac app, and I\'ve been banging my head against a wall for the past few hours on what I think should be really, r

4条回答
  •  忘了有多久
    2021-02-07 07:15

    To my knowledge, Xcode doesn't currently support using .xcassets for document icons. This is a little strange—the .xcassets editor clearly allows you to create new icons, but it doesn't generate .icns files, it just puts all the files in the same folder and uses a plist to manage them.

    To create an icon for your document types, upload the 1024x1024 version of the icon to http://iconverticons.com/online/ to convert it to a .icns file. Alternatively, you could use a third-party tool to generate an .icns file with different images for different resolutions. There used to be a great tool included in the Developer Tools for doing this, but I can't seem to find it anymore.

    Once you've got an icns file, add it to your project and you should be able to select it as the "Icon" for your Document Type or External/Internal UTI. Enjoy!

    To be honest, it might be worth filing a bug about this. Xcode's development seems so strongly driven by iOS these days, they may not have noticed this yet!

提交回复
热议问题