码迷,mamicode.com
首页 > 其他好文 > 详细

复习一下property

时间:2015-05-24 17:05:45      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:

 

在面向对象程序里,一个对象不要直接访问另一个对象内部的数据。所以我们使用accessor methods来进行对象内部的数据交互。

 accessor methods(getters and setters) are used as an abstraction for interacting with the object’s underlying data.

 

 

retain就是MRC版的strong

The retain attribute is the Manual Retain Release version of strong, and it has the exact same effect: claiming ownership of assigned values. You shouldn’t use this in an Automatic Reference Counted environment.

 

那么assign就是iOS5版本前的weak

The assign Attribute

The assign attribute doesn’t perform any kind of memory-management call when assigning a new value to the property. This is the default behavior for primitive data types, and it used to be a way to implement weak references before iOS 5

 

复习一下property

标签:

原文地址:http://www.cnblogs.com/studyNT/p/4526042.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!