方法名注意
-(void) sum:(int) a addNext: (int)b minus: (int) c;
//People.h
#import <Foundation/Foundation.h>
@interface People:NSObject
{
float _height;
NSString *_name;
int _age;
}
-(void)setHeight:(id)height;
-(id)height;
-(void)setName:(id)name;
-(id)name;
-(void)setAge:(int)age;
-(int)age;
@end
//People.m
#import "People.h"
@implementation People
-(void)setHeight:(id)height{
_height = height;
}
-(id)height{
return _height;
}
-(void)setName:(id)name{
_name = name;
}
-(id)name{
return _name;
}
-(void)setAge:(int)age{
_age = age;
}
-(int)age{
return _age;
}
@end
入口类省略