@implementation Person
//**************** set 方法的实现 *********
//_name的set方法,以后对_name设置值,一律使用此方法
-(void)setName:(NSString *)name{
//给实例变量赋值
_name = name;
}
//int _age;
-(void)setAge:(int)age{
_age = age;
}
//Sex _sex;
-(void)setSex:(Sex)sex{
_sex = sex;
}
//float _height
-(void)setHeight:(float)height{
_height = height;
}
@end
|
|