对象 实现该类,并: 1)查看本机信息 2)打电话给10086 3)给10086发短信问联通的客服电话是多少 */
#import <Foundation/Foundation.h>
@interface Iphone : NSObject{ @public
NSString *_cpu;
float _size;
NSString *_colol;
}
-(void)tste; -(void)call:(NSString*)thmyPhone; -(void)faduanxin:(NSString*)phonename andJiao:(NSString*)name;
@end
@implementation Iphone
-(void)tste{
NSLog(@"CPU:%@,尺寸:%.f,颜色:%@",_cpu,_size,_colol);
} -(void)call:(NSString*)thmyPhone{
NSLog(@"正在打电话给%@",thmyPhone);
}
-(void)faduanxin:(NSString*)phonename andJiao:(NSString*)name{
NSLog(@"给%@发短信,短信内容为:%@",phonename,name);
}
@end
int main(int argc, const char * argv[]) { @autoreleasepool {
} Iphone *p =[Iphone new];
p->_cpu=@"A9"; p->_size=5.5; p->_colol=@"土豪金";
[p tste];
[p call:@"10086打电话"];
[p faduanxin:@"10086" andJiao:@"联通电话号码多少"];
return 0; }
|