NSUInteger
NSUInteger is an unsigned integer type used in Apple's Cocoa and Cocoa Touch frameworks. It is the standard type for representing counts, lengths, and indices in APIs such as NSArray, NSString, NSData, and NSRange. The exact size of NSUInteger depends on the platform: it is 32 bits on 32-bit environments and 64 bits on 64-bit environments.
In Apple's headers, NSUInteger is typically defined as an unsigned long (typedef unsigned long NSUInteger). Because
Many APIs use NSUInteger for return values that indicate positions or lengths. A common sentinel value in
In Swift, NSUInteger is imported as UInt, reflecting the same unsigned, platform-dependent size semantics. When writing
See also: NSInteger, NSNotFound, NSUInteger constant, and API guidelines for counts and indices.