简体   繁体   English

导入非弧形库进行项目

[英]import a non-arc library to project

I try to import a non-arc library(ASIHTTPRequest) to project. 我尝试将非弧形库(ASIHTTPRequest)导入到项目中。

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. 是的,可以通过为单个文件添加-fno-objc-arc编译器标志来禁用单个文件的ARC。

在此处输入图片说明

You have to add non arc flag -fno-objc-arc in all ASIHttpRequest Classes in ProjectSettings->BuildPhases->Compile Sources 您必须在ProjectSettings-> BuildPhases-> Compile Sources中的所有ASIHttpRequest类中添加非弧标记-fno-objc-arc

在此处输入图片说明

ARC can be disabled on a ASIHTTPRequest files by file basis with the fno-objc-arc flag. 可以使用fno-objc-arc标志在ASIHTTPRequest文件上按文件禁用ARC。 Set the no-objc-arc flag at path ProjectSettings->BuildPhases->Compile Sources->ASIHTTPRequest .m files. 在路径ProjectSettings-> BuildPhases-> Compile Sources-> ASIHTTPRequest .m文件中设置no-objc-arc标志。

But it is better to use AFNetworking classes for HTTP request handling now. 但是现在最好将AFNetworking类用于HTTP请求处理。 AFNetworking is best on now days, whereas ASIHTTPRequest is pretty much dead. AFNetworking是目前最好的,而ASIHTTPRequest几乎已死。 Additionally, AFNetworking has dozens of great helper libraries and classes available for handling things like OAuth, Amazon S3, and the like. 此外,AFNetworking具有许多出色的帮助程序库和类,可用于处理OAuth,Amazon S3等内容。 AFNetworking also available for ARC support.No need to set flag. AFNetworking也可用于ARC支持。无需设置标志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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