Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
268 views
in Technique[技术] by (71.8m points)

iphone - Why are my ASIHTTPRequest files showing ARC errors?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...