I have the following code in my iPhone app
CGPoint p = [StaticClass doSomethingWithA:a doSomethingWithB:b];
but when I compile I get the following error:
error: conversion from ‘objc_object*’ to non-scalar type ‘CGPoint’ requested
Here is the prototype for my function:
+(CGPoint) doSomethingWithA:(UIImage*) from doSomethingWithB:(UIImage*) to
{
// Do Some stuff
return CGPointMake(ret.x, ret.y);
}
I think this is kind of a noob question but I’ve been doing app development for a while (self taught) and have kept running in to this and I don’t have a formal understanding of Objective C so I don’t know what is going on
It seems strange that you would HAVE to return a pointer type from any method … and I feel like I’ve definitely done stuff like this with flotas or ints before
Thanks
You probably didn’t import the correct header file, which means the compiler doesn’t know what the method returns and can’t generate the correct calling code.
Also, that’s not a function, it’s a class method. A function would look like: