咨询个objective-c的语法问题
kofwr 2010-07-09 03:34:35 在head first iphone development中看到关于属性的readwirte和retain有如下解释,
readwrite:When you want the property to be modifiable by people. The compiler will
generate a getter and a setter for you. This is the default
retain:When you’re dealing with object values. The compiler will retain the value
you pass in and release the
old value when a new one comes in.
请问readwrite自动生成的代码中,setter方法的实现是retain新的对象并release旧的对象吗?我觉得默认的readwrite属性应该符合内存管理的要求。