-2

NSInteger is integer object. So surely there should be long object?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
GeneCode
  • 7,545
  • 8
  • 50
  • 85

2 Answers2

5

NSInteger and NSUInteger are platform specific, so on 32 bit system is declared as an int and on 64 bit system it is declared as a long.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
1

NSInteger is a foundation type, as you can see here.

There are also other useful primitive types, like NSRect, NSSize, etc.

Apple simply chose not to have a NSLong or NSLongLong type defined in foundation.

More information as to when to use NSInteger (and what the considerations are behind them) can be found in this related question.

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215