Using Xcode to Create DGCar Class Files
Xcode is helpful in setting up the skeletal structure of your class
files, including the inheritance tree. Now is the time to follow along and
create the DGCar class files (and fill
them in as the chapter progresses).
Begin by selecting the Classes folder in the Files and Groups panel in the Workbench project window. Selecting this folder as a starting point causes Xcode to insert the files you’re about to create within the Class group. To see the next menu, you have two options:
Click to select the Classes folder and pull down the Action menu (the one with the gear icon).
Use your choice of secondary click (e.g., Ctrl-click, right-click with a two-button mouse, or two-finger-click with a trackpad) on the Classes folder to reveal the context-sensitive menu.
Choose Add to view the choices of new items you can create. Select New File, as shown in Figure 4-5.

Figure 4-5. The Add submenu
A New File window opens, shown in Figure 4-6. For the simple class
being created here, choose Cocoa Touch Class in the left column, then
Objective-C class in the top right group. Next, make sure you specify that
this will be a subclass of NSObject.
This will cause Xcode to fill in as many pieces as it can into the
skeleton files, including the superclass name. Click the Next
button.
Figure 4-6. Choices in the New File dialog window
The final step in the creation of the ...
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