#import <Foundation/Foundation.h>
typedef enum
{
tuhaojin,
heise,
baise
}Colr;
@interface Iphone: NSObject
{
@public
float _model;/**<型号*/
int _cpu;/**<Cpu*/
double _size;/**<尺寸*/
Colr _color;/**<颜色*/
}
void about();
-(NSString*)about;
+(NSString*)single:(long)number
name:(char*)name;
@end
@implementation Iphone
+(NSString*)single:(long)number
name:(char*)name
{
NSString *str = [NSString stringWithFormat:@"%s打电话过来了,他的电话是%ld",name,number];
return str;
}
-(NSString*)about
{
NSString *name;
switch (_color) {
case 0:{
name = @"土豪金";
return name;}
break;
default:
break;
}
return nil;
}
@end
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSLog(@"%@",[Iphone single:18381320308 name:"shenqian"]);
Iphone *p = [Iphone new];
NSLog(@"%@",[p about]);
}
return 0;
}