类 / 构造函数

@interface Man : NSObject
@property NSString *name;
-(id) initWithName: (NSString *) name;
@end

@interface Employee : Man
@property NSString *position;
-(id) initWithName: (NSString *) name;
@end

@implementation Employee
-(id) initWithName: (NSString *) name {
    self = [super initWithName:name];
    if (self) {
        self.position = @"unknown";
    }
    return self;
}
@end

Employee *employee = [[Employee alloc] initWithName:@"Max"];
//employee.position is "unknown"