Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.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 toDegrees toDegrees编译器问题_Iphone_Objective C_Compiler Construction_Warnings - Fatal编程技术网

iphone toDegrees toDegrees编译器问题

iphone toDegrees toDegrees编译器问题,iphone,objective-c,compiler-construction,warnings,Iphone,Objective C,Compiler Construction,Warnings,我试着用目标c函数的环面,将双折射率转换成弧度,如下所示: double oldLat = toRadians(oldLocation.coordinate.latitude); location = [[CCDirector sharedDirector] convertToGL:location]; // Determine offset of location to projectile int offX = location.x - PROJECTIL

我试着用目标c函数的环面,将双折射率转换成弧度,如下所示:

double oldLat = toRadians(oldLocation.coordinate.latitude);
location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);
但我不断收到编译器警告和错误,或是托拉迪安和托德格的隐式声明

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);
我包括了
#import
,但出于某种原因,这并没有解决问题

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);

任何帮助都是非常值得赞赏的。< / P> < P >基础课上没有TrADADIANS。您可以手动转换它

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);
degrees*M_PI/180.0

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);
基金会导入了math.h,所以你将有M_PI,否则你将不得不

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);

<代码>包括< /代码>

< P >基础类中没有TrADADIAN。您可以手动转换它

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);
degrees*M_PI/180.0

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);
基金会导入了math.h,所以你将有M_PI,否则你将不得不

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);
#包括

尝试以下编码:-(弧度到度)

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);
尝试以下编码:-(弧度到度)

location = [[CCDirector sharedDirector] convertToGL:location];

        // Determine offset of location to projectile
        int offX = location.x - PROJECTILE_POSITION_X;
        int offY = location.y - PROJECTILE_POSITION_Y;

                int realX = winSize.width + (PROJECTILE_WIDTH/2);
        float ratio = (float) offY / (float) offX;
        int realY = (realX * ratio) + PROJECTILE_POSITION_Y;

        int offRealX = realX - PROJECTILE_POSITION_X;
        int offRealY = realY - PROJECTILE_POSITION_Y;

        // Determine angle to face
        float angleRadians = atanf((float)offRealY / (float)offRealX);
        float angleDegrees =  (__angleRadians__)/((__angleRadians__) * 57.29577951f);