Question

I need about 100 icons inside my application. Would it be logical to have one large image file with all the icons and then somehow split it up into individual NSImage objects? Is there a way to run some code at build time to regenerate the individual icons?

Was it helpful?

Solution

Assuming you are indeed using the icons separately, I think it would be more logical to keep them separated, for a couple of reasons:

  1. It might seem more organized to reduce the total number of files, but having one big file with all your icons isn't a terribly organized method of storing them, either. Xcode can deal fine with a large number of icon files.
  2. If you're using version control, it complicates the management of the history a bit. As it stands now, if you need to change an icon, you just change that icon, and you can keep a history of changes to that icon. If the icons are in one big file, then any time you change any icon, that file will show up in the history, so it'll be hard to isolate what changes to what icons you made.
  3. It's probably easier to edit a single icon than a bunch of icons smashed together into one file.
  4. Why write a build script or runtime code to slice up the icons if you don't have to?

OTHER TIPS

100 icons? Woot? Okay,

No it would not be logical. It is possible to split them at runtime, not at build time. I would simply use the easy way and add all icons as different files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top