Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone “XCode错误”;二进制表达式“”的操作数无效;_Iphone_Ios5_Xcode4.3 - Fatal编程技术网

Iphone “XCode错误”;二进制表达式“”的操作数无效;

Iphone “XCode错误”;二进制表达式“”的操作数无效;,iphone,ios5,xcode4.3,Iphone,Ios5,Xcode4.3,我有一个NSTimeInterval,它存储为双精度。我想使用%运算符获取第二个值内的分钟数 int remainingSeconds = scratch % 60; 错误表示“二进制表达式的操作数无效”指向% 请提供帮助。模数用于整数,因此要使代码正常工作,请执行以下操作 int remainingSeconds = (int)scratch % 60; 要在浮子上使用模数,请使用fmod int remainingSeconds = fmod(scratch, 60); 在这里检查答案

我有一个NSTimeInterval,它存储为双精度。我想使用%运算符获取第二个值内的分钟数

int remainingSeconds = scratch % 60;
错误表示“二进制表达式的操作数无效”指向%
请提供帮助。

模数用于整数,因此要使代码正常工作,请执行以下操作

int remainingSeconds = (int)scratch % 60;
要在浮子上使用模数,请使用fmod

int remainingSeconds = fmod(scratch, 60);
在这里检查答案