I have the following line in code:
#define INACTIVITYTIMEBEFOREBAITARROWDISPATCHED 60.0
I get an error on this line that says, Too many arguments to method call, expected 1, have 2
Did I exceed the maximum length? If so, what is the maximum length? In any case, the actual message seems absurd.
Per request, here is the context:
#define VITALITYSECONDS 40.0
#define MINIMUMSCALEFACTOR 0.10
#define MINIMUMSPEED 2.0
#define INACTIVITYTIMEBEFOREBAITARROWDISPATCHED 60.0
#pragma mark - Angle and Distance Functions
-(float)normalizeAngle:(float)angle
{
float answer;
// Take an angle and return a value from -pi to pi
// To do this, we first add pi, then divide by 2pi, then take fractional part, then multiply by 2pi then subtract pi.
answer = angle + M_PI;
answer = answer/(2*M_PI);
answer = answer - floor(answer);
answer = answer * 2 * M_PI;
answer = answer - M_PI;
return answer;
}
For completeness, here is the offending line:
[self helpText:@"Bait arrow dispatched due to %f seconds inactivity\n",INACTIVITYTIMEBEFOREBAITARROWDISPATCHED];
And here is the corrected version:
[self helpText:[NSString stringWithFormat:@"Bait arrow dispatched due to %f seconds inactivity\n",INACTIVITYTIMEBEFOREBAITARROWDISPATCHED]];
Here is the declaration for that method:
-(void)helpText:(NSString *)text
Method helpText is just a temporary method to display stuff on screen to help out the testers.
its not an issue with the define. it an issue with the method.
Does the method take in an arg list ? or just a string.
Because it looks like you are trying to set a string by using a format.
try this out