zoukankan      html  css  js  c++  java
  • 转:在支持ARC工程中编译不支持ARC的文件

    转:http://blog.csdn.net/duxinfeng2010/article/details/8709697

    实践总结:-fno-objc-arc 设置 解决了 旧代码中存在 release autorelease retain 等手动管理内存代码的错误.

    Xcode4.2(iOS 5)以后启用了ARC技术,虽然4.2以后版本仍然可以不开启ARC,但是我们在建工程的时候有时为了不想管理内存然后就启用了ARC,但是再开发过程中需要用到第三开发类库,而这些第三方类库或是没做更新而不支持ARC,然后编译时就出现下列错误:

    [cpp] view plain copy
    1. 'release' is unavailable: not available in automatic reference counting mode  
    2. ARC forbids explicit message send of 'release'  
    3. 'autorelease' is unavailable: not available in automatic reference counting mode  
    4. ARC forbids explicit message send of 'autorelease'  
    5. 'retain' is unavailable: not available in automatic reference counting mode  
    6. ARC forbids explicit message send of 'retain'  


    解决办法:

    1.在targets->build phases中修改compiler Flags属性,添加:-fobjc-arc,就可以让旧的工程支持arc;

    2.在targets->build phases中修改compiler Flags属性,添加:-fno-objc-arc,就可以让原来支持arc的工程不使用arc,对于大部分第三方类库来说都可以顺利编译通过

  • 相关阅读:
    lamp架构之升级php版本
    Linux常用命令大全
    Mysql表连接查询
    PHP练习题三
    PHP练习题二
    php 设计模式
    LAMP环境搭建教程
    Storm入门(四)WordCount示例
    Storm入门(三)HelloWorld示例
    Storm入门(一)原理介绍
  • 原文地址:https://www.cnblogs.com/swing07/p/5536354.html
Copyright © 2011-2022 走看看