简体   繁体   中英

import a non-arc library to project

I try to import a non-arc library(ASIHTTPRequest) to project.

but it reports arc error.

Is there a way to import a non-arc library to arc project?

Your comment welcome

Yes, It is possible to disable ARC for individual files by adding the -fno-objc-arc compiler flag for those files.

在此处输入图片说明

You have to add non arc flag -fno-objc-arc in all ASIHttpRequest Classes in ProjectSettings->BuildPhases->Compile Sources

在此处输入图片说明

ARC can be disabled on a ASIHTTPRequest files by file basis with the fno-objc-arc flag. Set the no-objc-arc flag at path ProjectSettings->BuildPhases->Compile Sources->ASIHTTPRequest .m files.

But it is better to use AFNetworking classes for HTTP request handling now. AFNetworking is best on now days, whereas ASIHTTPRequest is pretty much dead. Additionally, AFNetworking has dozens of great helper libraries and classes available for handling things like OAuth, Amazon S3, and the like. AFNetworking also available for ARC support.No need to set flag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM