寫(xiě)一個(gè)setter方法用于完成@property(nonatomic, strong)NSString *name,
寫(xiě)一個(gè)setter方法用于完成@property(nonatomic, copy)NSString *name
- (void)setName:(NSString*)str //retain
{
[str retain];
[_name release];
_name = str;
}
- (void)setName:(NSString *)str //copy
{
id t = [str copy];
[_name release];
_name = t;
}