标签:style blog color 使用 ar div cti sp log
@interface … @property (原子性,可写性,内存管理) id name; @end
@property id name; //等价于下一行: @property (atomic, readwrite, assign) id name;
-(void) setName:(id)name; -(id) name;
-(void) setName: (id) aName { self.name = aName; } -(id) name { return self.name; }
-(void) setName: (id) aName { if ([self.name retainCount > 0]) { [self.name release]; } [aName retain]; self.name = aName; } -(id) name { [self.name retain]; return self.name; }
-(void) setName: (id) aName { if ([self.name retainCount > 0]) { [self.name release]; } self.name = [copy aName]; } -(id) name { [self.name retain]; return self.name; }
标签:style blog color 使用 ar div cti sp log
原文地址:http://www.cnblogs.com/code-style/p/3956429.html