9

I have implemented all of my ASIHTTPRequest files, but unfortunately the following errors occur:

enter image description here

enter image description here

Why is this happening?

pixelbitlabs
  • 1,916
  • 6
  • 36
  • 65
  • The error messages are perfectly explicit. It's telling you that you can send `retain`, `release`, and `dealloc` methods with ARC. – Abizern Dec 04 '11 at 14:17
  • please read this entry. [click this for Link][1] [1]: http://stackoverflow.com/questions/8633903/files-doesnt-support-the-arc-feature-how-to-deal-with – wolcy97 Feb 05 '13 at 11:11

5 Answers5

30

ASIHTTPRequest doesn't support ARC, so it is expected you get errors if you use it in an project with ARC enabled.

There are various solutions on how to disable ARC just for the asihttprequest files suggested here:

https://github.com/pokeb/asi-http-request/issues/210

The easiest one is just to disable ARC for the ASIHTTPRequest source files, see here : How can I disable ARC for a single file in a project?

Someone has started what they called an ARC compliant HTTPRequest - basically a very small wrapper around NSURLConnection that has a similar interface to ASIHTTPRequest:

https://github.com/imathome/ARCHTTPRequest

It doesn't support all/most of the features of the full ASIHTTPRequest though.

Finally, a lot of people are moving to use AFNetworking instead. The more recent versions all use ARC, although as the recommended way to use it is via CocoaPods the ARC compiler flags will be sorted out correctly automatically:

https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking

Community
  • 1
  • 1
JosephH
  • 36,107
  • 19
  • 126
  • 149
  • ARC is applied on a per-file basis, so there should be no problem with just turning ARC off for ASIHTTPRequest's files. – Caleb Dec 21 '11 at 07:12
6

Try this new framework MKNetworkKit

https://github.com/MugunthKumar/MKNetworkKit

This supports ARC

Rowdur
  • 602
  • 4
  • 11
  • MKNetworkKit seemed to be abandoned, the last commit is from Oct. 2015, there are pulling requests waiting and no news from anyone. Do you know another good option ? – Link14 Mar 09 '16 at 23:11
0

you can use this. If you are using ARC. Benefit of using it is that i just create a wrapper over native URLConnection class so native support of libraries is more reliable.

https://github.com/samspalace/SIKHttpRequest-ARC

Salman Iftikhar
  • 301
  • 2
  • 9
0

This is happening because when you enable ARC you cannot use the standard memory management methods like "retain", "release", etc. Just delete those method calls and you'll be fine. Or, if you want you can turn off ARC for those files.

sosborn
  • 14,486
  • 2
  • 39
  • 45
0

ARC stands for automatic reference counting , where ios itself looks after retain, release , so either you should disable ARC or get the new ARC supported ASIHTTPRequest files... cheers.

Ankit Srivastava
  • 11,975
  • 9
  • 57
  • 111