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.
NSInteger
is a type definition that describes an integer - but it is NOT equivalent to int
on 64-bit platforms.
You can examine the typedef by cmd-clicking on NSInteger
in Xcode.
NSInteger
is defined as int
when building a 32-bit app and as long
for 64-bit apps.
Most of the time you can replace int with NSInteger, but there are some things to consider when doing so.
Apple's 64-Bit Transition Guide for Cocoa has some information about that.
NSNumber is a class that helps you to store numeric types as object. It has methods to convert between different types and methods to retrieve a string representation of your numeric value.
If you use a variable day
of type NSNumber*
the way you did in your example, you are not modifying the value of day
but its memory address.
If you are working with time values you also could take a look at NSDate.