stevenpcurtis
stevenpcurtis

Reputation: 2001

OCMock setup for iOS with CocoaPods

Trying to set up OCMock in iOS using CocoaPods, have a problem that persists in a new (trivial) project. This is in Xcode 8 but I suspect the problem is the setup rather than the use of CocoaPods.

I have the error: implicit declaration of function ‘OCMClassMock’ is invalid in C99

In my Podfile I have the following: pod 'OCMock', '~> 2.2'

I then followed the ocmock iOS Project setup as best I could and did the following:

#import <OCMock/OCMock.h> @interface FinanceCalcWithTestsTests : XCTestCase @end - (void)testMasterViewControllerDeletesItemsFromTableView { id tableViewMock = OCMClassMock([UITableView class]); }

Upvotes: 0

Views: 1002

Answers (1)

Erik Doernenburg
Erik Doernenburg

Reputation: 3014

Okay, I just noticed what could be the solution: you are telling CocoaPods to get OCMock 2.2, but you are trying to use a feature that was only introduced in OCMock 3.0...

Upvotes: 1

Related Questions