2008年2月27日 星期三

declared property

目的: 節省自己寫getter, setter來access instance variable的時間。


how to define:
@property(attributes) Type variableNameList;
ex: @prperty(copy) NSString *name;

where is the location to define?
in header file, after close brace ( } )

how to define method:
use synthesize, the compiler will define accessor methods for you:
ex: @synthesize dog;

沒有留言: