views:

43

answers:

2

I am trying to inegerate Google Toolbox for mac for unit testing purposes on this page http://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting is says add blahblah.m file to your target & add blahblah.m file to your project.

What is the difference, how should I add to target...

+1  A: 

Do "Get Info" on the file after dragging it into your project. You'll see checkboxes for each target. Just check the checkbox, or make sure it's checked, to make sure it's added to your target.

Adding something to the project usually, depending on the file type, automatically adds it to all targets that make sense.

Adding a file to a target tells the build system that the target depends on that file and that the file should be incorporated into the target build somehow. In the case of resources they're simply copied into the application bundle. In the case of .m files, they're compiled and linked.

I'm not familiar with Google Toolbox, but chances are that for unit testing you want your unit test .m files to be added to your unit test-running target and not your actual application target so they don't get compiled into your app.

Nimrod
+3  A: 

In order to "Add to project" you simply have to drag the file into Xcodes sidebar. Eventually it should look like this:

Xcode sidebar screenshot

"Add to target" means that the file has to be in the "Compile Sources" group of your LogicTests-target.

Xcode target screenshot

You can also check if a file has been added to the currently active target by looking at the right Checkbox in the "Detail" panel:

Xcode detail panel

Chilloutman