assign: 简单赋值,不更改索引计数 -(void)setMyObject:(id)newValue{ _myObject = newValue; } copy: 建立一个索引计数为1的对象,然后释放旧对象 -(void)setMyObject:(id)newValue{ if (_myObject != newValue) { [_myObject release]; _myObject = [newValue copy]; } } retain:释放旧的对象,将旧对象的值赋予输入对象,再提高输入对象的索引计数为1 -(void)setMyObject:(id)newValue{ if (_myObject != newValue) { [_myObject release]; _myObject = [newValue retain]; } } readonly表示这个属性是只读的,就是只生成getter方法,不会生成setter方法.