导入类非自动引用计数到我的项目时出错 [英] having errors when import class non-Automatic Reference Counting to my project

查看:38
本文介绍了导入类非自动引用计数到我的项目时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只需创建一个新项目,然后选中自动引用计数"并下载另一个项目即可.当我将下载的类导入到我的项目中时,搜索后发现出现了太多错误,因为下载的项目是非自动引用计数.

Just create new project and checked Automatic Reference Counting and downloaded another project. when I import the downloaded classes to my project, it gives too much errors, after searching I found that because the downloaded project is non-Automatic Reference Counting .

那么,请问该问题的解决方案是什么?

so, what is the solution for this problem please ?

推荐答案

之所以会发生这种情况,是因为诸如"release"之类的调用会在ARC项目中引起错误,因此您不会使用它们,因为编译器会为您执行此操作.要在类上保持启用ARC并在导入的类上禁用ARC,请转到构建阶段,然后将编译器标志"-fno-objc-arc"添加到要使用手动内存管理的类.

This occurs because calls like "release" cause errors in ARC projects so that you don't use them because the compiler does this for you. To keep ARC enabled on your classes and disable it on the class you've imported go to your build phases and add the compiler flag "-fno-objc-arc" to the class that you want to use manual memory management.

这篇关于导入类非自动引用计数到我的项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆