给定这样的数组示例:
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 中实现这一点?