ARC Rules
To write and compile source code for ARC, you have to take care of a few things. Just by following the rules in the list below, you can write source code for an ARC-enabled environment with confidence.
Forget about using retain, release, retainCount, and autorelease.
Forget about using NSAllocateObject and NSDeallocateObject.
Follow the naming rule for methods related to object creation.
Forget about calling dealloc explicitly.
Use @autoreleasepool instead of NSAutoreleasePool.
Forget about using Zone (NSZone).
Object type variables can’t be members of struct or union in C language.
‘id’ and ‘void*’ have to be cast explicitly.
As described previously, the compiler doesn’t manage variables with the __unsafe_unretained ownership qualifier. You have to take care of ownership yourself to avoid a memory leak or the application will crash.
Conversely, __bridge_transfer cast will release the object just after the assignment is
ARC Rules的更多相关文章
- ARC __bridge modifiers demystified
http://stackoverflow.com/questions/14207960/arc-bridge-modifiers-demystified Because I learned what ...
- 一篇文章彻底弄清ARC始末
本文转载至 http://blog.csdn.net/allison162004/article/details/38758265 自动引用计数(ARC)是编译器的一个特色,提供了Objective- ...
- iOS ARC下命名规则
当我在ARC模式下写以下代码的时候,编译器报错 Semantic Issue: Property's synthesized getter follows Cocoa naming conventio ...
- Convert BSpline Curve to Arc Spline in OpenCASCADE
Convert BSpline Curve to Arc Spline in OpenCASCADE eryar@163.com Abstract. The paper based on OpenCA ...
- 黑马程序员——ARC机制总结和用ARC建立模型
ARC 全称:Automatic Reference Counting 使用ARC 只需要在建立一个新的项目的时候把 下面的√打上 Xcode5以后都会默认建议开发者使用ARC机制 新的项目中如果有部 ...
- [Android]使用自定义JUnit Rules、annotations和Resources进行单元测试(翻译)
以下内容为原创,欢迎转载,转载请注明 来自天天博客:http://www.cnblogs.com/tiantianbyconan/p/5795091.html 使用自定义JUnit Rules.ann ...
- Favorites of top 10 rules for success
Dec. 31, 2015 Stayed up to last minute of 2015, 12:00am, watching a few of videos about top 10 rules ...
- JSONKit在项目中使用设置(ARC与方法更新)
在项目中经常会遇到解析json的情况,如果有同学想要解析JSON,那么JSONKit可以是一个不错的选择. git中JSONKit 的地址为:https://github.com/johnezang/ ...
- MRC迁移ARC之__block
今日帮着同事把老项目从MRC迁移至ARC,大部分工作无非是删除release,[super dealloc]等方法,只要关闭了MRC编译选项后,编译器能自动帮你检查,block就有一些不一样了,发现许 ...
随机推荐
- Tortoise SVN 更换用户
由于之前没有找到 svn 的安装路径,所以用了同事的 svn 账号,今天找到了并且添加了用户,所以 tortoise svn 要更换用户: ① ② ③ 需要清除的 svn 账号打上勾 参考:svn怎么 ...
- git 使用钩子直接推送到工作目录
远端机器 $ mkdir /www/teacherapi # 创建工作目录 $ cd /data/git $ git init teacherapi.git --bare --shared Init ...
- eclipse SDK更新管理器安装插件
1.在Eclipse的主菜单,点击help,选择Install New Software 2.Work with: Indigo - http://download.eclipse.org/relea ...
- 20145235《Java程序设计》第7周学习总结
教材学习内容总结 13.1 认识时间与日期 格林威治时间(GMT):通过观察太阳而得,因为地球公转轨道为椭圆形且速度不一,本身自传减速而造成误差. 世界时(UT):通过观测远方星体跨过子午线而得,受地 ...
- 初学Java语法(笔记)
2015-12-30
- Virtual Memory PAGE TABLE STRUCTURE
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION The basic mechanism f ...
- Java - HttpURLConnection
JDK中的URLConnection参数详解 1:> URL请求的类别: 分为二类,GET与POST请求.二者的区别在于: a:) get请求可以获取静态页面,也可以把参数放在URL字串后面,传 ...
- Flink - Juggling with Bits and Bytes
http://www.36dsj.com/archives/33650 http://flink.apache.org/news/2015/05/11/Juggling-with-Bits-and-B ...
- nodejs 基本类型和语法
写在前面 今天想要查下Node的类型什么的知识,想要总结下,在Googol上看到一个文章,但是原始的链接不在了,在快照中把这篇文章拉出来,如果原作者有问题,请联系我! 该文章都是一些JS的基础,高手自 ...
- 【转】const 是左结合的,若左边为空,则再向右结合
const 是左结合的,若左边为空,则再向右结合 一.指向 const 对象的指针指向 const 对象的指针,指的是指针指向的对象的内容是const的,不可修改,但指针本身(即指针的值)是可 ...