#import <Foundation/Foundation.h>
@interface Person : NSObject
{
NSString *_name;
NSString *_age;
NSString *_sex;
NSString *_address;
NSString *_phone;
NSString *_group;
}
-(instancetype)initWithName:(NSString *)name
age:(NSString *)age
sex:(NSString *)sex
address:(NSString *)address
phone:(NSString *)phone;
+(Person *)personWithName:(NSString *)name
age:(NSString *)age
sex:(NSString *)sex
address:(NSString *)address
phone:(NSString *)phone;
-(NSString *)name;
-(NSString *)age;
-(NSString *)sex;
-(NSString *)address;
-(NSString *)phone;
-(NSString *)group;
-(void)setName:(NSString *)name;
-(void)setAge:(NSString *)age;
-(void)setSex:(NSString *)sex;
-(void)setAddress:(NSString *)address;
-(void)setPhone:(NSString *)phone;
-(void)setGroup:(NSString *)group;
#import "Person.h"
@implementation Person
-(instancetype)initWithName:(NSString *)name age:(NSString *)age sex:(NSString *)sex address:(NSString *)address phone:(NSString *)phone
{
self = [super init];
if (self)
{
_name = name;
_age = age;
_sex = sex;
_address = address;
_phone = phone;
}return self;
}
+(Person *)personWithName:(NSString *)name
age:(NSString *)age
sex:(NSString *)sex
address:(NSString *)address
phone:(NSString *)phone
{
Person *p = [[Person alloc] initWithName:name age:age sex:sex address:address phone:phone];
return p;
}
-(NSString *)name
{
return _name;
}
-(NSString *)age
{
return _age;
}
-(NSString *)sex
{
return _sex;