Changing Calculator’s Application Icon
To show you how to change the application icon for our Calculator,
we’ll assume that you’ve saved a
copy of the file AppIcon.icns in your
~/Calculator folder as we described in the
previous section. (If you haven’t done this, copy
the file with this name from
/Developer/Examples/AppKit/DotView or some other
AppKit example). Then we’ll tell
PB to use an image from
AppIcon.icns for our
Calculator’s application icon. When the Calculator
program is compiled, the icon’s image will
automatically be included in the Calculator’s
NSBundle folder.
Back in PB with
Calculator.pbproj, choose Project → Add Files.Select the
AppIcon.icnsfile, as shown in Figure 6-21, and click the Open button.

Figure 6-21. Adding the AppIcon.icns file to the Calculator project
As shown in Figure 6-22, PB will prompt you as to
whether or not you wish to copy the items that you have just selected
(e.g., the AppIcon.icns file) into the
destination group’s folder. The setting of this
checkbox does not matter, because you already copied the
AppIcon.icns file into your project directory.

Figure 6-22. Option to copy AppIcon.icns into project directory
Do not change any settings in the newly dropped sheet; simply click the Add button.
The AppIcon.icns file should now show up in the Groups ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access