-2

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

rmaddy
  • 307,833
  • 40
  • 508
  • 550
GeneCode
  • 7,266
  • 8
  • 45
  • 82

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
  • 68,719
  • 8
  • 132
  • 164
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
  • 87,822
  • 17
  • 159
  • 205