报错原因是 项目使用的是ARC,但是有非ARC代码。 项目中要混合使用ARC和非ARC。

解决:

  1. target -> Build Phases -> Compile Sources
  2. 双击报错的 *.m 文件
  3. 在窗口中输入-fno-objc-arc

  如果使用的非 ARC ,则为 ARC 的代码加入 -fobjc-arc

  如果使用的是 ARC ,则为非 ARC 代码加入 -fno-objc-arc

判断项目是否用的ARC:

error: 'retain' is unavailable: not available in automatic reference counting. 解决办法的更多相关文章

  1. error: 'release' is unavailable: not available in automatic reference counting,该怎么解决

    编译出现错误: 'release' is unavailable: not available in automatic reference counting mode.. 解决办法: You nee ...

  2. [转]error: 'retainCount' is unavailable: not available in automatic reference counting mode

    转载地址:http://choijing.iteye.com/blog/1860761   后来发现是编译选项的问题:   1.点击工程名 打开编译选项 2.在编译选项中,选择Bulid Settin ...

  3. [转]关于NSAutoreleasePool' is unavailable: not available in automatic reference counting mode的解决方法

    转载地址:http://blog.csdn.net/xbl1986/article/details/7216668 Xcode是Version 4.2 Build 4D151a 根据Objective ...

  4. 错误解决:release' is unavailable: not available in automatic reference counting mode

    解决办法: You need to turn off Automatic Reference Counting. You do this by clicking on your project in ...

  5. not available in automatic reference counting mode

    UncaughtExceptionHandler.m:156:47: 'autorelease' is unavailable: not available in automatic referenc ...

  6. ARC(Automatic Reference Counting )技术概述

    此文章由Tom翻译,首发于csdn的blog 转自:http://blog.csdn.net/nicktang/article/details/6792972 Automatic Reference ...

  7. xcode禁用ARC(Automatic Reference Counting)

    Automatic Reference Counting,自动引用计数,即ARC,可以说是WWDC2011和iOS5所引入的最大的变革和最激动人心的变化.ARC是新的LLVM 3.0编译器的一项特性, ...

  8. JSONKit does not support Objective-C Automatic Reference Counting(ARC) / ARC forbids Objective-C objects in struct

    当我们在使用JSONKit处理数据时,直接将文件拉进项目往往会报这两个错“JSONKit   does not support Objective-C Automatic Reference Coun ...

  9. iOS开发 JSonKit does not support Objective-C Automatic Reference Counting(ARC)

    有使用JSonKit的朋友,如果遇到“JSonKit does not support Objective-C Automatic Reference Counting(ARC)”这种情况,可参照如下 ...

随机推荐

  1. enum & json 之间的转换

    enum 转为 string:EnumMember & StringEnumConverter public enum CampaignStatus : Int32 { [EnumMember ...

  2. python中模块的__all__详细使用

    python模块中的__all__,用于模块导入时限制,如:from module import * 此时被导入模块若定义了__all__属性,则只有__all__内指定的属性.方法.类可被导入:若没 ...

  3. OO随笔

    第一次作业——多项式计算 1.自我程序分析 第一次作业是多项式计算,只使用了一个多项式类.第一次接触面向对象的程序,还比较生疏,不是很能理解面向对象的思想.将读入,处理,计算,都放到了main函数中, ...

  4. Linux之DHCP搭建命令集锦

    systemctl start dhcpd        //启动DHCP systemctl enable dhcpd                //配置服务开机启动 ps aux | grep ...

  5. How Many Zeroes? LightOJ - 1140

    #include<stdio.h> #include<string.h> #include<math.h> #include<time.h> #incl ...

  6. Ubuntu16.04安装Anaconda2

    1.下载Anaconda2: 官网上下载相应的版本,我下载的是Anaconda2-2018.12-Linux-x86_64.sh 2.安装Anaconda2: 在文件的目录输入命令:bash Anac ...

  7. photoKit使用笔记

    @主要用到的类 1PHAssetCollection:图片资源数组(代表着相簿数组) 作用:获取相簿资源数组 示例代码: //获取相簿资源 PHFetchResult<PHAssetCollec ...

  8. 利用scrapy-client 发布爬虫到远程服务端

    远程服务端Scrapyd先要开启 远程服务器必须装有scapyd,并开启. 这里远程服务开启的端口和ip: 192.166.12.80:6800 客户端配置和上传 先修爬虫项目文件scrapy.cfg ...

  9. 关于微信小程序获取当前位置信息

    小程序开发---获取当前位置信息 一.获取用户地理位置信息 1.配置app.json文件 { "pages": ["pages/index/index"], & ...

  10. JDK7动态代理源码分析

    IObject proxy = (IObject) Proxy.newProxyInstance(IObject.class.getClassLoader(), new Class[]{IObject ...