RestKit作为子项目而不是CocoaPod

时间:2014-04-02 04:11:52

标签: ios restkit restkit-0.20

我正在将RestKit集成为XCode中的子项目,但刚刚开始使用Cocoapods。当RestKit是一个子项目时,我进行了没有问题的集成测试,但是现在通过Cocoapods引入后,它似乎没有发出任何请求。这是我的基本测试用例:

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];

如上所述,从那里返回的RKObjectRequestOperation总是为nil,而之前它会按预期工作。以下是测试的控制台输出:

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

我习惯在这里看到来自RestKit的请求/响应输出,但现在什么都没有。

1 个答案:

答案 0 :(得分:0)

由于通过CocoaPods拉入RestKit(可能处于错误状态),或者在我的本地缓存/构建目录中,我的项目配置中出现了一些问题。在拉下干净的工作副本并再次执行CocoaPods集成后,它开始工作。