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 simply an integer, NSNumber
is an object where as int
is a primitive data type.
NSInteger is nothing more than a synonym for a long integer.
If you need to store a number somewhere, use NSNumber. If you're doing calculations, loops, etc, use NSInteger, NSUInteger or int.
You can wrap an NSInteger into an NSNumber using:
NSNumber *NumberToStore = @(21);
and get it back using:
NSInteger retrievingInteger = [NumberToStore integerValue];