Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failing to import OCMock headers into iOS project

I'm trying to add OCMock to my current project using the instructions at ocmock.org.

  1. Added the library and the headers to the project.
  2. Made sure that the libOCMock.a is added to my test target.
  3. Added the search path to the header files in Header Search Paths under Build Settings for the test target.
  4. Added the flags -force_load, PATH/TO/libOCMock.a and -ObjC to Other Linker Flags (also to the test target).
  5. Finally I import the headers in a test class like this: #import <OCMock/OCMock.h>

The first thing that happens is that Xcode complains about not finding the headers. If I go ahead and try to build the test target I get an error: OCMock/OCMock.h not found.

When I check the build output I can se that it is adding the correct search path: -I/Users/username/Development/proj/iphone/frameworks/OCMock_2_0_1/headers

When I list the path in the terminal I can clearly see the files there.

Any help or pointers in the right direction would be greatly appreciated. <3

like image 559
ABeanSits Avatar asked Nov 04 '22 04:11

ABeanSits


1 Answers

Solved it with the help of a friend (thank you so much A.)!

I had changed the name of the folder that contained the headers to headers while the import was pointing to OCMock/OCmock.h. :/

like image 125
ABeanSits Avatar answered Nov 13 '22 20:11

ABeanSits