Obj-C ... Error "Incompatible types on initialization"

My code:

CGPoint *tp_1 = CGPointMake(160, 240);

      

gives the error "Incompatible types on initialization" ... why is that?

+2


source to share


2 answers


CGPointMake

returns a struct, not a pointer to a structure. Therefore the correct code is:



CGPoint tp_1 = CGPointMake(160, 240);

      

+11


source


It looks like CGPointMake is not returning a pointer.



0


source







All Articles