报错原因是 项目使用的是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. continue #结束本次循环,继续下一次代码

    for i in range(10):     if i <5:         continue     print(i)     for j in range(10):         pr ...

  2. 关于transactionscope 事务的脏数据

    在一个项目中,关于新客的检测,如果查询到积分记录就是老客,因为检测的之前先积分,因为使用的是事务,造成本地代码没提交前已经有该会员的积分记录,而到数据库中却查询不到记录.造成永远都是老客,解决的方法是 ...

  3. Django使用redis实现缓存

    实现缓存的方式,有多种:本地内存缓存,数据库缓存,文件系统缓存.这里介绍使用Redis数据库进行缓存. 配置 CACHES = { "default": { "BACKE ...

  4. EntityFrameworkCore将数据库Timestamp类型在程序中转为long类型

    EntityFrameworkCore将数据库Timestamp类型在程序中转为long类型 EntityFrameworkCore Entity public class Entity { publ ...

  5. 牛客OI周赛9-提高组题目记录

    牛客OI周赛9-提高组题目记录 昨天晚上做了这一套比赛,觉得题目质量挺高,而且有一些非常有趣而且非常清奇的脑回路在里边,于是记录在此. T1: 扫雷 题目链接 设 \(f_i\) 表示扫到第 \(i\ ...

  6. 【笔记】Nginx热更新相关知识

    (以下学习笔记内容均摘自参考链接,仅供个人查阅)   1.inotify文件系统监控特性 Inotify 是一个 Linux 内核特性,它监控文件系统,并且及时向专门的应用程序发出相关的事件警告,比如 ...

  7. 规则引擎 drools

    https://www.jianshu.com/p/725811f420db 深入了解Drools 简单介绍 笔者正在做风控系统,风控系统里边存在非常多的规则(比如:age < 16 || ag ...

  8. C++之标准库vector

    目录 1.成员函数 2.元素访问 3.迭代器iterator 4.容量capacity 5.修改函数 std::vector是一个封装动态数组的序列容器 std::pmr::vector是一个使用多态 ...

  9. Js 语言中 变量提升问题

    变量提升: 提升变量的声明. 函数声明式: 像这种形式: function foo() {}: 会发生变量提升. 函数表达式: var fn=function fn(){}: 不会发生变量提升.var ...

  10. iOS调试踩过的坑 以及instruments使用指南

    1. 低版本的XCode工程中包含的lib,在高版本的XCode中会编译错误,提示找不到库,故需要恢复libC++库到原位置上,参考 https://github.com/devdawei/libst ...