Student.h:
#import <Foundation/Foundation.h> @interface Student : NSObject +(id)student; -(void)test; @end
Student.m:
#import "Student.h" @implementation Student +(id)student{ return [[[Student alloc] init] autorelease]; } -(void)test:(NSString *) str{ NSLog(@"%@->test-%@",self,str); } -(void)dealloc{ NSLog(@"Student%@被销毁了",self); [super dealloc]; } @end
main:
#import <Foundation/Foundation.h> #import "Student.h" void arrayCreate(){ //静态
本文转自蓬莱仙羽51CTO博客,原文链接:http://blog.51cto.com/dingxiaowei/1366478,如需转载请自行联系原作者