gpt4 book ai didi

iphone - valueForKey 只返回内存地址而不返回实际值

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

    NSDictionary *topic = [spaces objectAtIndex:i];
NSInteger topicid = [topic valueForKey:@"TOPICID"];

当我运行它并打印出主题时,我得到以下信息:

Printing description of topic:
<CFDictionary 0xdb2a70 [0x30307a00]>{type = mutable, count = 2, capacity = 12, pairs = (
10 : <CFString 0xdb5300 [0x30307a00]>{contents = "TOPICID"} = 29
12 : <CFString 0xdb53a0 [0x30307a00]>{contents = "TOPICNAME"} = <CFString 0xdb5360 [0x30307a00]>{contents = "zzzzzzzz"}
)}

但是,当我查看topicid时,其值始终是一个内存地址。我做错了什么?

最佳答案

也许这个值实际上是一个 NSNumber。你会得到这个使用:

NSInteger topicid = [[topic objectForKey:@"TOPICID"] intValue];

关于iphone - valueForKey 只返回内存地址而不返回实际值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1572653/

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