Compile only some classes in project
Is there a way to only build certain classes? I am testing code in one part of the application and I don't wa开发者_如何学Pythonnt to have to change it all across the program if it is not going to work correctly.
You have multiple possibilities:
- Select the file you want to compile, then select the "Compile" item in the "Build" menu
- Create a new target in your project (target dedicated for this debugging) using item "New Target" of the "Project" menu (Xcode3), then only include the classes/files you want to build in this Xcode target.
If you choose to create a dedicated target, you can easily switch between this new target (to compile only the selected classes) and the main target (to compile the whole app) and vice-versa, at any time.
(if you only need to compile one class for the day until you finish your refactoring but won't need this later, it's probably not worth creating a target; But creating a target could be useful if you intend to test this class on its own in multiple occasions during your development phases)
精彩评论