views:

155

answers:

2

I've followed the Unit Testing Applications guide from the iPhone Development documentation. I followed all the steps and it worked with the TestCase from the documentation. But as soon as I changed the TestCase to test real Code from my project I ended up with linker errors. All classes that are used in the TestCase are reported as missing.

I've already searched the internet and found that the Bundle Loader property must be set to "$(BUILT_PRODUCTS_DIR)/MyApplication.app/Contents/MacOS/MyApplication". But this also fails because the file could not be found.

Any ideas what I have to do to tell the linker where to search for the missing files?

A: 

This is not an answer, but I'm unable to add this as a comment on your question.

Can you provide an actual error? What does the "real code" attempt to do? You seem to have blindly copied a MacOS Unit Testing configuration into an iPhone project... you should remove that before trying anything else.

I have my own iPhone Unit Testing linker question that might be relevant to your situation:

Linker Error: iPhone Unit Test Bundle referencing App classes

ohhorob
+1  A: 

Make sure that you have added your classes to the unit test target. So if you are creating a unit test for class foo right click on foo.m, select info and then from the Targets tab ensure the checkbox for your unit test target is selected.

kharrison