Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.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 二进制表达式的无效操作数('double'和'double')目标c问题_Iphone_Ios_Objective C - Fatal编程技术网

Iphone 二进制表达式的无效操作数('double'和'double')目标c问题

Iphone 二进制表达式的无效操作数('double'和'double')目标c问题,iphone,ios,objective-c,Iphone,Ios,Objective C,二进制表达式“double”和“double”的操作数无效目标c问题 -(double)performOperationWith:(double *)operand1 And:(double *)operand2 { double result = 0.0; result = operand1 + operand2; return result; } 只需拆下*: 它们是指针,因此您应该取消对它们的引用: res

二进制表达式“double”和“double”的操作数无效目标c问题

-(double)performOperationWith:(double *)operand1 
                         And:(double *)operand2 {

    double result = 0.0;

    result = operand1 + operand2;

    return result;
}
只需拆下*:


它们是指针,因此您应该取消对它们的引用:

result = *operand1 + *operand2;
或更改功能参数:

-(double)performOperationWith:(double )operand1 And:(double )operand2 {...}

我是一名Android程序员,我想学习iOS。我忘了指针
-(double)performOperationWith:(double )operand1 And:(double )operand2 {...}