I have yet another pesky warning I would like gone. Basically, I have an int declared like this: @property (nonatomic, assign) int *myInt; and set like this: myInt = 0;. It is also synthesized in the implementation file. I am getting a warning on the line where I set the int’s value and it says Incompatible intiger to pointer conversion assigning to 'int *' from 'int'. What should I do to fix this?
I have yet another pesky warning I would like gone. Basically, I have an
Share
There’s a big hint in the error message!
In C and Objective C, an
intis a primitive data type. You’ve writtenint *, which means “a pointer to an int”, whereas it looks like you just wanted an int.So change your property to this:
For more info, google “C pointers” and you’ll find information like this: http://pw1.netcom.com/~tjensen/ptr/pointers.htm