//iPhone类的声明
typedef enum iphonecolor{hei,bai,thj,mgj} ys;
@interface iphone : NSObject
{ //属性
@public
float _size;
NSString *_cpu;
ys _color;
}
//类的行为
- (void)aboutMyphone;
- (void)call:(NSString *)telnum;//打电话,需要传参数
- (void)sendMessage:(NSString *)telnum andcotent:(NSString *)cotent;//发短信
@end
//类的实现
@implementation iphone
- (void)aboutMyphone{
NSLog(@"尺寸是:%.2f,颜色是:%d,CPU是:%@,",_size,_color,_cpu);
}
- (void)call:(NSString *)telnum{
NSLog(@"给%@打电话",telnum);
}
- (void)sendMessage:(NSString *)telnum andcotent:(NSString *)cotent{
NSLog(@"给%@发短信:%@,",telnum,cotent);
}
彻底懵了 |
|