Database Reference
In-Depth Information
Figure 2-6. The project view of a workspace with a subproject
What this looks like on the file system, in an abbreviated form, is this:
./BuggyWhipChat
./BuggyWhipChat/BuggyWhipChat
./BuggyWhipChat/BuggyWhipChat/DetailViewController.h
./BuggyWhipChat/BuggyWhipChat/DetailViewController.m
./BuggyWhipChat/BuggyWhipChat/RootViewController.h
./BuggyWhipChat/BuggyWhipChat/RootViewController.m
./BuggyWhipChat/BuggyWhipChat/TwitterAPI.h
./BuggyWhipChat/BuggyWhipChat/TwitterAPI.m
./BuggyWhipChat/BuggyWhipChat.xcodeproj
./ChatAPI
./ChatAPI/ChatAPI
./ChatAPI/ChatAPI.xcodeproj
./ChatAPI/ChatAPI.xcodeproj/project.pbxproj
Diane also needs to make the main project depend on the new ChatAPI project. There
are a few ways to do this, but probably the easiest is to select the BuggyWhipChat
project, go to the Build Phases view, and add ChatAPI as a target dependency. Xcode
is supposed to figure this out automatically, but I've had hit-or-miss luck with it, so I
prefer to do it explicitly. While she's there, she also has to add the library archive from
the subproject as a linked library for the main project (see Figure 2-7 ).
Also, somewhat annoyingly, Diane has to manually add a relative path to the ChatAPI
directory to the Header Search Paths build setting for the parent project, so that the
parent can reference any new header files that Diane creates after the split. Or, alter-
natively, she can copy the header files into the main project, although this will get you
back into the scenario of having two people modifying the same project file.
The final step is to move the TwitterAPI source and header into the new subproject,
and remove the references from the main project. Because Xcode associates projects
and groups with physical location on disk, they're going to still be in the BuggyWhip-
Chat directory. If you're obsessive (or your company is) about directory organization,
you'd probably want to move the files physically to the correct directory, and use Add
Files... to recreate the references in the ChatAPI project.
 
Search WWH ::




Custom Search