Hi,
I wrote a class that calculate point ,
the .M file of the class:
the .H file of the class:
How do I call the class and the method "CalculatePoint" from the main program ?
Thanx
I wrote a class that calculate point ,
the .M file of the class:
Code:
#import "GameBrain.h"
@implementation GameBrain
-(int)CalculatePoint:(int)ArrowPoint,int NewPoint {
if(ArrowPoint>NewPoint) {
NewArrowPoint=ArrowPoint-NewPoint;
NewArrowPoint*=-1;
}
else
NewArrowPoint=NewPoint-ArrowPoint;
return NewArrowPoint;
}
@end
the .H file of the class:
Code:
#import <Foundation/Foundation.h>
@interface GameBrain : NSObject {
int NewArrowPoint;
}
-(int)CalculatePoint:(int) ArrowPoint,int NewPoint;
@end
How do I call the class and the method "CalculatePoint" from the main program ?
Thanx