I have a method:
- (CGPoint) calculateVectorBetweenThisPoint:(CGPoint)firstPoint andThisPoint:(CGPoint)secondPoint
{
float xDif = firstPoint.x - secondPoint.x;
float yDif = firstPoint.y - secondPoint.y;
return CGPointMake(xDif, yDif);
}
And I try to invoke it as follows:
- (float) angleBetweenThisPoint:(CGPoint)firstPoint andThisPoint:(CGPoint)secondPoint
{
// COMPILE ERROR HERE: Invalid Initializer
CGPoint vector = [self calculateVectorBetweenThisPoint:firstPoint andThisPoint:secondPoint];
return atan2(vector.x, vector.y);
}
But I get a compilation erorr where I try to use the method: "Invalid Initializer".
What am I doing wrong?