newbie stuck: ASIHTTPRequest - no known class meth

2019-08-08 18:01发布

问题:

I am referencing ASIHTTPRequest and got it to compile in iOS5.

However when I try to use it:

ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];

I get the error

no known class method for selector 'requestWithURL'.

Also setCacheStoragePolicy and startAsynchronous throw errors.

Indeed I can't see that method in the ASIHTTPRequest.m file. What am I missing? This is the latest code download from github.

Thanks, John.

回答1:

Go to target and check ASIHTTPRequest.m is a part of compiler source or not.

Make a clean build and try to build one more time. I

f that don’t work, try to update your code. I can see those method in github code.



回答2:

Make sure you have CFNetwork.framework, SystemConfiguration.framework, MobileCoreServices.framework, CoreGraphics.framework and libz.dylib added into your project.

kReachabilityChangedNotification is declared in Reachability.h(which is located in a folder called "External" in the ASIHTTPRequest package), so make sure to add Reachability.h & Reachability.m from the "External" folder into your project