Question

I was integrating RestKit as a subproject in XCode but just started using Cocoapods. I had integration tests that passed without issue when RestKit was a subproject, but now after bringing it in through Cocoapods it doesn't appear to be making ANY requests. Here is my basic test case:

RKObjectRequestOperation *requestOperation = [[RKObjectManager sharedManager] appropriateObjectRequestOperationWithObject:args method:RKRequestMethodPOST path:@"/users/auth/login" parameters:@{@"email": args.email, @"password": args.password}];

//requestOperation is always nil for some reason
[requestOperation start];
[requestOperation waitUntilFinished];

As stated above, the RKObjectRequestOperation returned from there is always nil, whereas before it would work as expected. Here is the console output from the test:

2014-04-02 00:08:45.523 App[81180:90b] I restkit:RKLog.m:33 RestKit logging initialized...
2014-04-02 00:08:45.526 App[81180:90b] I restkit:RKLog.m:33 RestKit logging initialized...
Test Suite 'All tests' started at 2014-04-02 04:08:45 +0000
Test Suite 'AppTests.xctest' started at 2014-04-02 04:08:45 +0000
Test Suite 'AppTests' started at 2014-04-02 04:08:45 +0000
Test Case '-[AppTests testLogin]' started.
/Users/matthewbaker/iOS/AppTests/AppTests.m:41: error: -[AppTests testLogin] : ((success) is true) failed - Login failed
Test Case '-[AppTests testLogin]' failed (0.001 seconds).
Test Suite 'AppTests' finished at 2014-04-02 04:08:45 +0000.
Executed 1 test, with 1 failure (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'AppTests.xctest' finished at 2014-04-02 04:08:45 +0000.
Executed 1 test, with 1 failure (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'All tests' finished at 2014-04-02 04:08:45 +0000.
Executed 1 test, with 1 failure (0 unexpected) in 0.001 (0.003) seconds

I'm used to seeing request/response output from RestKit here, but now there is nothing.

Was it helpful?

Solution

Something was badly messed up either in my project configuration as a result of pulling RestKit in through CocoaPods (maybe got put in a bad state), or in my local caches/build directories. After pulling down a clean working copy and performing the CocoaPods integration again it started working.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top