And again, for what it's worth, if anyone wants to know how to put some of their code into a static library without a cross referenced project, or as I put it, put code that's "done" somewhere so it doesn't have to be included in your build everytime you do a clean and then build, here's how to do it....
First, though, two suggestions:
1) Right click on "Groups and Files" in the Group Tree, and check "Target Membership". This will let you easily see which files are in which targets by displaying a checkbox next to each file in the Group Tree, which you can check/uncheck to add or remove a file from the current target.
2) When you do a "Clean" or "Clean All Targets", generally speaking, uncheck "Also clean dependencies" and "Also Remove Precompiled Headers", as this is generally speaking not required (it's only required if you've changed code in one of your static libraries, or if you've changed a pch file (i think!)
Now to move code into a static library:
- Right click "Targets" and choose "Add | New Target | Static Library"
- Call it what you like, eg. completedCode
- Now you've got to add this new static library to your main app, or main target. Simply right click on your main apps target, and choose "Get Info"
- Click the "+" button under "Direct Dependencies", and add the "completedCode" library
- Use the "target membership" checkboxes to add and remove files from the current target. So to remove them from your main app simply uncheck them, then switch to the target for your static library by changing "active target" to your static library, and then checking them there.
- Now you'd think that'd be all you have to do, but you have to also go under the "Products" section in the group tree, and you'll find a file named libcompletedCode.a. Drag it into your apps "Link Binary with Libraries" section under it's target.
Now you can do a build. If the build fails, it simply means that you need to add any required frameworks to your static library. Just right click on the target for the library and choose "Add | Existing Frameworks" and add any frameworks your library depends on.
That should be it. Now when you build your main app, it won't build all your files anymore. It'll only build the files that are directly in your main app's target. And when you do a clean, make sure you follow suggestion 2) above, as that'll make it so you don't need to rebuild any of your static libraries (e.g. cocos, box2d, chipmunk, completedCode, etc)
Hope it helps!
Brad