报错原因是 项目使用的是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. elasticsearch-mapping字段重要属性

    https://blog.csdn.net/gongpulin/article/details/78705205

  2. 王之泰201771010131《面向对象程序设计(java)》第十三周学习总结

    第一部分:理论知识学习部分  第11章 事件处理 11.1 事件处理基础 a)事件源(event source):能够产生事件的对象都可 以成为事件源,如文本框.按钮等.一个事件源是一个 能够注册监听 ...

  3. Bigger-Mai 养成计划,Python基础巩固二

    模块初识1.标准库2.第三方库import sys sys.path #自己的本文件名不可为sys.py#输出模块存储的环境变量sys.argv #打印脚本的相对路径sys.argv[2] #取第二个 ...

  4. ES6多层解构

    const info = { person: { name: 'xiaobe', other: { age: 22, } }, song: 'rolling', } // 解构person的内容 co ...

  5. poj1676

    保存不完整数字可能对应的数字,注意小时<24,分钟小于59. AC代码 #include <stdio.h> #include <vector> using namesp ...

  6. [Linux]最新sublime text 3显示图标

    sublime text 3显示图标 执行命令 sudo vim /usr/share/applications/sublime_text_3.desktop 添加相应信息 [Desktop Entr ...

  7. C#_计算目前时间到指定的周X、指定的时间X 还有多少秒

    比如:当前时间到下周二 05:00:00还剩下多少秒? /// <summary> /// 计算距离下一个 周XX XX时XX分XX秒,还剩下多少秒 /// </summary> ...

  8. SSM框架完成Ajax简单用户登录验证

    一.前端JSP <%@ page contentType="text/html;charset=UTF-8" language="java" %> ...

  9. js统一设置富文本中的图片宽度

    var txt = layedit.getContent(ieditor);//获取编辑器内的文本var regex = new RegExp('<img', 'gi');txt = txt.r ...

  10. 记录下用axios遇到的问题

    这两天用axios做页面登录.遇到了N多问题,.首先是报Response to preflight request doesn't pass access control check: No 'Acc ...