Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OCMock for iPhone (iOS4, XCode 3.2.3)

I have the last version of OCMock (1.55) and XCode 3.2.3.

I have created a test bundle target in my project. What is the best way to use OCMock in my tests? When I add OCMock.framework to the test bundle, this build error appears:

  "_OBJC_CLASS_$_OCMockObject", referenced from:
  objc-class-ref-to-OCMockObject in NotificationTests.o
  ld: symbol(s) not found
  collect2: ld returned 1 exit status
like image 954
alexey Avatar asked Aug 22 '26 21:08

alexey


2 Answers

I had the same problem, here is how i solved it :

  • Delete ocmock.framework, the copy file phase, and any search path linking to ocmock header.

  • check out the latest version from ocmock svn repo : http://svn.mulle-kybernetik.com/OCMock/trunk

  • Build the OCMockPhoneSim target

  • Copy the libOCMock.a and Headers folder in your project folder

  • add the libOCMock.a to your framework and add a link to the headers folder in your target library search path.

Then it works !

Hope this helps.

like image 177
vdaubry Avatar answered Aug 25 '26 10:08

vdaubry


See Colin Barrett's "OCMock and the iPhone" tutorial.

like image 42
Kristopher Johnson Avatar answered Aug 25 '26 11:08

Kristopher Johnson



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!