下面代码执行后的输出结果为( )?
@interface Person:NSObject{
NSString* name;
}
- (void) setName:(NSString*) yourName;
@end
@interface PersonMe:Person {
NSUInteger age;
}
- (void) setAge:(NSUInteger) age;
- (void) setName:(NSString*) yourName andAge:(NSUInteger) age;
@end
@implementation PersonMe
- (void) setName:(NSString*) yourName andAge:(NSUInteger) age {
[self setAge:age];
[super setName:yourName];
NSLog(@"self' class is %@", [self class]);
NSLog(@"super' class is %@", [super class]);
}
@end
int main(int argc, char* argv[]) {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]
PersonMe* me = [[PersonMe alloc] init];
[me setName:@"asdf" andAge:18];
[me release];
[pool drain];
return 0;
}
Aself' class is PersonMe
super' class is Person
Bself's class is PersonMe
super' class is PersonMe
Cself' class is Person
super' class is PersonMe
Dself's class is Person
super' class is Person