一个是使用self的内存(类方法),一个是需要新alloc内存(实例方法)。
比如有一个类 example
里面定义 了两个方法
+(void)fun1; //类方法
-(void)fun2; //实例方法
用法:
[example fun1];
example *tmp = [[example alloc]init];
[tmp fun2];
一个是使用self的内存(类方法),一个是需要新alloc内存(实例方法)。
比如有一个类 example
里面定义 了两个方法
+(void)fun1; //类方法
-(void)fun2; //实例方法
用法:
[example fun1];
example *tmp = [[example alloc]init];
[tmp fun2];