十六进制字符串转化为十进制值strtoul函数
eg:
NSString *strtest =@"7fffffff"; NSUInteger val = strtoul([[strtest substringWithRange:NSMakeRange(0, 8)] UTF8String], 0, 16); NSLog(@"val = %d", val);
打印结果:
2015-09-28 17:26:51.420 iOSTest[2855:535794] val = 2147483647