Data Types
The Foundation Framework defines a number of custom data types, many of which are used in conjunction with the Foundation functions. These include data types that represent numbers, geometric concepts, and general structures. These data types are primarily C structures. Some of the more common are listed in Table 13-4.
Table 13-4. Common Foundation Data Types
Foundation Function | Description |
---|---|
NSInteger | Data type used to represent an integer value across different processor architectures. On 32-bit machines, NSInteger is a 32-bit integer; whereas on 64-bit machines, it is a 64-bit integer. |
NSUInteger | Data type used to represent an unsigned integer value across different processor architectures. |
NSDecimal | C struct data type used to represent a decimal number. |
NSPoint | C struct data type used to represent a point in two-dimensional Euclidean space. |
NSRange | C struct data type used to represent a range, a one-dimensional quantity beginning at a specified location of a specified length. |
NSSize | C struct data type used to represent a size, two-dimensional quantity of specified width and height. |
NSRect | C struct data type used to represent a rectangle in two-dimensional Euclidean space. |
NSComparator | A block object data type used for comparison operations. The block returns a Foundation constant NSComparisonResult that indicates the ordering of the two objects compared. |
NSTimeInterval | A Foundation type (of type double) used to specify a time interval, in seconds. |
NSStringEncoding | A Foundation type (of type NSUInteger) used to represent string encoding values. |