error: 'retain' is unavailable: not available in automatic reference counting. 解决办法
报错原因是 项目使用的是ARC,但是有非ARC代码。 项目中要混合使用ARC和非ARC。
解决:
- target -> Build Phases -> Compile Sources
- 双击报错的 *.m 文件
- 在窗口中输入-fno-objc-arc
如果使用的非 ARC ,则为 ARC 的代码加入 -fobjc-arc
如果使用的是 ARC ,则为非 ARC 代码加入 -fno-objc-arc
判断项目是否用的ARC:

error: 'retain' is unavailable: not available in automatic reference counting. 解决办法的更多相关文章
- error: 'release' is unavailable: not available in automatic reference counting,该怎么解决
编译出现错误: 'release' is unavailable: not available in automatic reference counting mode.. 解决办法: You nee ...
- [转]error: 'retainCount' is unavailable: not available in automatic reference counting mode
转载地址:http://choijing.iteye.com/blog/1860761 后来发现是编译选项的问题: 1.点击工程名 打开编译选项 2.在编译选项中,选择Bulid Settin ...
- [转]关于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 ...
- 错误解决: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 ...
- not available in automatic reference counting mode
UncaughtExceptionHandler.m:156:47: 'autorelease' is unavailable: not available in automatic referenc ...
- ARC(Automatic Reference Counting )技术概述
此文章由Tom翻译,首发于csdn的blog 转自:http://blog.csdn.net/nicktang/article/details/6792972 Automatic Reference ...
- xcode禁用ARC(Automatic Reference Counting)
Automatic Reference Counting,自动引用计数,即ARC,可以说是WWDC2011和iOS5所引入的最大的变革和最激动人心的变化.ARC是新的LLVM 3.0编译器的一项特性, ...
- 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 ...
- iOS开发 JSonKit does not support Objective-C Automatic Reference Counting(ARC)
有使用JSonKit的朋友,如果遇到“JSonKit does not support Objective-C Automatic Reference Counting(ARC)”这种情况,可参照如下 ...
随机推荐
- 为git关联编辑器(比如notepad++) Associating text editors with Git
Associating text editors with git Using Notepad++ as your editors you can set your default editor in ...
- SPOJ COT Count on a tree(树上主席树 + LCA 求点第k小)题解
题意:n个点的树,每个点有权值,问你u~v路径第k小的点的权值是? 思路: 树上主席树就是每个点建一棵权值线段树,具体看JQ博客,LCA用倍增logn求出,具体原理看这里 树上主席树我每个点的存的是点 ...
- java 随机出题四则运算
作业要求来源于:https://edu.cnblogs.com/campus/gzcc/GZCC-16SE2/homework/2186 我的github地址:https://github.com/k ...
- 查看 linux 目录大小
查看 linux 目录大小 du -sm * | sort -n # 以m显示并按小到大排序
- loadrunner中使用web_custom_request函数调用webservice接口
1.使用的接口地址: http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?op=getWeatherbyCityName 以SOAP ...
- linux命令 xxd
xxd,能够查看linux下文件的二进制表示.man一下xxd.能够得到下面信息 NAME xxd - make a hexdump or do the reverse. SYNOPSIS ...
- Python汉诺塔问题
汉诺塔描述 古代有一座汉诺塔,塔内有3个座A.B.C,A座上有n个盘子,盘子大小不等,大的在下,小的在上,如图所示.有一个和尚想把这n个盘子从A座移到C座,但每次只能移动一个盘子,并且自移动过程中,3 ...
- L - Non-Prime Factors (质数筛选+因子分解)
In many programming competitions, we are asked to find (or count the number of) Prime Factors of an ...
- PDO设置字符集
<?php header("content-type:text/html;charset=GBK"); class CurlClass { protected $_pdo; ...
- Python面向对象编程 -- 类和实例、访问限制
面向对象编程 Object Oriented Programming,简称OOP,是一种程序设计思想.OOP把对象作为程序的基本单元,一个对象包含了数据和操作数据的函数. 面向过程的程序设计把计算机程 ...