【发布时间】:2010-10-30 09:43:57
【问题描述】:
以这样的数组为例:
idx = [ 0xe, 0x3, 0x6, 0x8, 0x2 ]
我想获得 Objective C 中每个指定项的整数和字符串表示形式。我已经模拟了一个完美运行的 ruby 示例:
0xe gives 14 when i run 0xe.to_i and "e" when i run to_i(base=16)
0x3 gives 3 when i run 0x3.to_i and gives 3 when i run to_i(base=16)
如何在 Objective C 中实现这一点?
【问题讨论】:
-
这些是非本地化数字吗?
标签: objective-c cocoa hex