1.类的声明(以Car为例)
@interface Car:NSObject
{
int lunzi;
char *color;
int speed;
}
@end
//方法的声明
2.类的实现
@implementation Car
@end
3.对象的创建
Car *car=[Car new];
car->lunzi=3;
car->color=@"blue";
car->speed=150;
NSLog(@"%d,%@,%d",car->lunzi,car->color,car->speed);
|
|