gpt4 book ai didi

objective-c - 将 NSString 转换为 unsigned long long 的问题

转载 作者:搜寻专家 更新时间:2023-10-30 20:22:30 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Storing and retrieving unsigned long long value to/from NSString

尝试将 NSString 转换为 unsigned long long 时遇到问题。继承人的代码:

    NSString* mp3id = [[NSString alloc] initWithUTF8String:"16902439379132728577"];

NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
NSNumber* persistentId = [f numberFromString:mp3id];

unsigned long long test = [persistentId unsignedLongLongValue];
NSLog(@"unsigned long long is %llu",test);
[f release];

输出:

2011-07-09 15:28:06.834 NBUnityMP3Plugin[443:307] unsigned long long 是 169024393791327293442011-07-09 15:28:06.847 NBUnityMP3Plugin[443:307] 持久性 ID 为 1.690243937913273e+19

为了更清楚:

16902439379132728577 - input
16902439379132729344 - output

理想情况下,我希望将那个 unsigned long long 放入一个 NSNumber 变量中。我认为如果我只有一个 unsigned long long,那会很容易。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com