Anyone have the expertise to explain when to use NSUInteger and when to use NSInteger?
I had seen Cocoa methods returning NSInteger even in cases where the returned value will always be unsigned.
What is the fundamental reason? Is NSInteger or int strictly limited to if we want to represent negative value?
From NSObjCRuntime.h:
#if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif