#import
@interface Person : NSObject
@property(nonatomic) NSString *name;
@property(nonatomic) int age;
-(void)say;
@end
#import "Person.h"
@implementation Person
-(void)say
{
NSLog(@"my name is %@, I am %d years old !",_name,_age);
}
@end
#import "Person.h"
@interface Student : Person
{
int idnumber;
int classnumber;
NSString *classname;
}
-(void)say;
-(id)initWithId:(int)_idnumber andWithClassnumber:(int)_classnumber andWithClassname:(NSString *)_classname andWithName:(NSString *)_name andWithAge:(int)_age;
@end
我在person类里.h文件里面有两个属性,使用自动初始化,然后student类继承了person类,在增加了三个属性现在我要创建一个student类的对象 请问我们门初始化这个students类啊?