Learn Objective-C on the Mac - Mark Dalrymple [12]
Single-click the Help menu so the menu title is selected, then press the delete key. The menu should disappear. That’s all five done, well done!
Save your nib file by pressing ⌘S. We’re now done with Interface Builder, at least for the time being. You can leave Interface Builder open if you want, because we’ll be using it in the next chapter, but close the nib file’s main window because we won’t be editing this particular nib any more. After closing it, go back to Xcode.
Creating Your Application Icon
One thing that all applications need is an icon. Mac OS X uses a special file format for icons, and the developer tools you downloaded includes an application named Icon Composer designed to help you create the .icns files you’ll need. You can find Icon Composer on your hard drive at /Developer/Applications/Utilities/Icon Composer.app.
You need to start your icon in an image-editing program such as Photoshop, Acorn, or GIMP. You should create your original file at a size of 512×512 pixels, and save it in a standard image format that supports alpha channels (transparency) such as TIFF, PSD, or PNG. Once you have your original file saved, launch Icon Composer, and drag your image to the Icon Composer window. Icon Composer will convert your image into the right format, and even let you specify different images for different sizes. This is a handy feature if you’ve got details in the 512×512 image that are important but which won’t be readable at smaller sizes. In that situation, you can create a slightly different version for the smaller sizes to make sure that the important details can be seen no matter what icon size is used. Figure 2-19 shows Icon Composer in action.
After you’ve imported the image or images that make up your icon, you can save the document to a .icns file, which can be imported into your Xcode project to serve as your application’s icon.
To save you the trouble of creating your own icon, we’ve provided a .icns file you can add to your project. If you’d rather roll your own, go right ahead and use Icon Composer to create a file named hello world.icns.
Alternatively, you can use the hello world.icns file you’ll find in the 02 - Hello World folder that came with the downloaded project files.
Figure 2-19. Designing an icon in Icon Composer. Note that you can specify different versions of the icon for different sizes.
Adding Your Icon to Your Project
Whether you created an icon yourself or you are using ours, drag your hello world.icns file from the Finder to Xcode’s Resources group (Figure 2-20) in the Groups & Files pane of Xcode, which tells Xcode that you want to import this file into your project. You can also select Add to Project… from the Project menu if you prefer to select the file using the standard file browser rather than using drag and drop.
Figure 2-20. Dragging a file to the Groups & Files pane is one way to import a file into an Xcode project.
When you let go of the mouse button or select the file to be imported, a sheet will appear (Figure 2-21), allowing you to specify how you want to import the file. The main item to be concerned with on this sheet is the checkbox at the top, which asks you if you want to copy the object into the project folder. If this checkbox is turned on, Xcode will create a copy of the file in your project’s folder and then import that copy into your project. If that box is not selected, then it will add the file to the project by linking to the original file.
Most of the time, you will want to do copy the file into your project folder, as it keeps all the resources for your project together. However, if you share resources among more than one project, then