#import <Foundation/Foundation.h>
@interface myClass : NSObject
{
@public
int age;
int height;
}
@end
@implementation myClass
-(void) view : (int)key1 : (int)key2
{
NSLog(@"person=[%d][%d]",age,height);
NSLog(@"key1=[%d] key2=[%d]",key1,key2);
}
@end
int main(int argc, const char * argv[])
{
@autoreleasepool {
myClass *personA = [[myClass alloc] init];
myClass *personB = [[myClass alloc] init];
personA->age = 5;
personA->height = 150;
personB->age = 10;
personB->height = 180;
[personA view:1:2]; //引数1,2
[personB view:10:20]; //引数10,20
}
return 0;
}