newbie stuck: ASIHTTPRequest - no known class method for selector 'requestWithURL'

北城以北 提交于 2019-12-11 07:54:40

问题


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



来源:https://stackoverflow.com/questions/8844668/newbie-stuck-asihttprequest-no-known-class-method-for-selector-requestwithur

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!