gpt4 book ai didi

ios - #define 指令上的这个错误是什么?

转载 作者:行者123 更新时间:2023-11-29 13:22:28 24 4
gpt4 key购买 nike

<分区>

我在代码中有以下行:

#define INACTIVITYTIMEBEFOREBAITARROWDISPATCHED 60.0

我在这一行上收到一条错误消息,上面写着,方法调用的参数太多,预期 1,有 2

我是否超过了最大长度?如果可以,最大长度是多少?无论如何,实际的信息似乎很荒谬。

根据请求,这里是上下文:

#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;
}

为了完整起见,这里是有问题的行:

[self helpText:@"Bait arrow dispatched due to %f seconds inactivity\n",INACTIVITYTIMEBEFOREBAITARROWDISPATCHED];

这是更正后的版本:

[self helpText:[NSString stringWithFormat:@"Bait arrow dispatched due to %f seconds inactivity\n",INACTIVITYTIMEBEFOREBAITARROWDISPATCHED]];

这是该方法的声明:

-(void)helpText:(NSString *)text

方法 helpText 只是一种在屏幕上显示内容以帮助测试人员的临时方法。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com