I have a line of code that will work differently depending on the datatypes \"day\" and \"1\". I believe it is the following although I will check my source code later.
1
is a literal and the compiler will make it the appropriate numeric type if that's appropriate.
Note, however, that while NSInteger
and int
are to most intents and purposes the same thing, NSNumber
is an object type. For that case, your code doesn't make sense (and shouldn't compile without warnings).
(Actually, there are some circumstances where it would make a kind of sense, in terms of pointer arithmetic, but that's totally not what you want.)
For the NSNumber case, you'd instead want something like:
day = [NSNumber numberWithInt:[day intValue] + 1];