objective c 实现继承 笔记
?
//// main.m// BaseTest//// Created by cheng deng on 11-8-26.// Copyright 2011年 __MyCompanyName__. All rights reserved.//#import <Foundation/Foundation.h>@interface shuma : NSObject {@private }- (void) areyou;@end@implementation shuma- (void) shuma{ NSLog(@"i am shuma product");}@end@interface Computer: shuma {@private}@end@implementation Computer- (void) shuma{ NSLog(@"i am a computer");}@endint main (int argc, const char * argv[]){ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; Computer *c = [Computer new]; [c shuma]; NSLog(@"test"); [pool drain]; return 0;}
?