gpt4 book ai didi

cocoa - 将 int32_t 存储在 NSDictionary 中

转载 作者:行者123 更新时间:2023-12-03 16:17:45 25 4
gpt4 key购买 nike

如何在 NSDictionary 中存储 int32_t 类型的变量(例如 ABPropertyID)?

[NSNumber numberWithInt:...] 似乎不起作用。

谢谢

<小时/>

来自评论:

NSLog(@" %@ %@ ", [NSNumber numberWithLong:kABPersonFirstNameProperty], kABPersonFirstNameProperty);

打印:0(空)有什么想法吗?

最佳答案

+[NSNumber numberWithInteger:] 将在所有 32 位和 64 位系统上很好地保存 32 位数字。 +[NSNumber integerValue] 将检索它。如果您需要未签名的值,可以使用``+[NSNumber numberWithUnsignedInteger:]`。

关于cocoa - 将 int32_t 存储在 NSDictionary 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2141863/

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