AliSoftware / OHHTTPStubs

Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
MIT License
5.04k stars 601 forks source link

can not find responseWithJSONObject:statusCode:headers: in OHHTTPStubsResponse #181

Closed hemster closed 8 years ago

hemster commented 8 years ago

Installed through CocoaPods, Use with AFNetworking 2.6.3

AliSoftware commented 8 years ago

Which subspec did you list in your Podfile? Did you include pod 'OHHTTPStubs/JSON'?

hemster commented 8 years ago

@AliSoftware nope, just pod 'OHHTTPStubs'. I thought it include all

AliSoftware commented 8 years ago

It includes all but the Swift subspec so if you're only using it from ObjC you should be OK on that front.

Did you import the header then (preferably with modular import)? What's your actual code?

hemster commented 8 years ago

Ha! You are right, I forgot to import the header.

I only imported

#import "OHHTTPStubs.h"

but not include

#import "OHHTTPStubsResponse+JSON.h"
AliSoftware commented 8 years ago

You should use modular imports instead (@import OHHTTPStubs;) which imports the whole module that would have avoided you the trouble :wink:

hemster commented 8 years ago

Cool! You rock!

hemster commented 8 years ago

@AliSoftware I tried '@import OHHTTPStubs;' , but it is not working properly. Xcode said module not found. QAQ

mikelupo commented 8 years ago

What about import <OHHTPStubs/OHHTTPStubs.h>

Sent from my iPhone

On Jun 13, 2016, at 11:34 PM, Hemster notifications@github.com wrote:

@AliSoftware I tried '@import OHHTTPStubs;' , but it is not working properly. Xcode said module not found. QAQ

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

hemster commented 8 years ago

@mikelupo not working, still OHHTPStubs/OHHTTPStubs.h file not found