基类如何包含子类作为成员?例如:
@interface Magic : NSObject {
@private
NSString* name;
int power;
int manaCost;
SpecialKindOfMagic* thisMuch;
}
@end
@interface SpecialKindOfMagic : Magic {
@private
int thisMuchSpecial;
}
@end
基类如何包含子类作为成员?例如:
@interface Magic : NSObject {
@private
NSString* name;
int power;
int manaCost;
SpecialKindOfMagic* thisMuch;
}
@end
@interface SpecialKindOfMagic : Magic {
@private
int thisMuchSpecial;
}
@end