Obj-C… “Incompatible types in initialization” error
-
21-09-2019 - |
Question
My code:
CGPoint *tp_1 = CGPointMake(160, 240);
gives an "Incompatible types in initialization" error... why is this??
Solution
CGPointMake
returns a struct, not a pointer to a struct. So the correct code is:
CGPoint tp_1 = CGPointMake(160, 240);
OTHER TIPS
Looks like CGPointMake isn't returning a pointer.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow