Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit Testing iPhone - Linker Errors

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?

like image 506
sliver Avatar asked Feb 26 '26 15:02

sliver


1 Answers

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.

like image 93
kharrison Avatar answered Mar 01 '26 06:03

kharrison



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!