I have an object Foo that has an NSNumber property which is declared like this:
@property (retain) NSNumber *siteID;
and @synthesized.
When I I do something like this:
Foo *myFoo = [[Foo alloc] init];
NSNumber *newNumber = [[NSNumber alloc] initWithInt:42];
myFoo.siteID = newNumber;
[newNumber release];
The assignment on line 3 that goes through the synthesized setter appears to work just fine- myFoo.siteID has the value I'm expecting I'm able to go about my business. However, I get a warning:
Passing argument 1 of 'setSiteID: makes integer from pointer without a cast'
I'm concerned I'm doing something wrong and approaching this assignment incorrectly even though everything appears to be functioning OK.
I understand that NSNumbers are immutable and I've read some other questions about not being able to assign the value. Apologies if there is an existing topic that covers this case or if I'm just missing something basic with the property declaration.
Thanks for any tips.