读书人

objective c 兑现继承 笔记

发布时间: 2012-06-27 14:20:09 作者: rapoo

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;}

?

读书人网 >移动开发

热点推荐