unsignedIntValue vs intValue

How*_*ard 0 iphone xcode objective-c ios

请考虑以下代码

id j = @"123";
NSUInteger a = [j unsignedIntValue]; // not working
NSUInteger b = [j intValue]; // works
Run Code Online (Sandbox Code Playgroud)

为什么在将NSString的对象转换为无符号整数时,只能intValue起作用?

omz*_*omz 10

这是因为unsignedIntValue是一个方法NSNumber,同时intValue存在于两个NSNumberNSString.