如何从CFMutableDictionary中检索特定键的值 [英] How to retrieve the values for the particular key from CFMutableDictionary
本文介绍了如何从CFMutableDictionary中检索特定键的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C ++中,EventType.find(1)->second
可用于查找键1的值.
In C++ EventType.find(1)->second
can be used to find the value for the key 1.
我是目标C的新手.我已经实现了CFDictionary
来为它增值.但是我怎么做
I am new to Objective C.I have implemented CFDictionary
to addvalue onto it.But how do i
retreive
并查看特定键的values
.
CFNumberRef tId = CFNumberCreate(NULL,kCFNumberShortType,&st);
CFDictionarySetValue(cfdict,tId,st);
NSLog(@"The value is:%s",(CFDictionaryGetValue(cfdict,tId)));
它正在运行,没有错误,但我无法获得输出.
Its running without error but i could not get the output.
推荐答案
CFMutableDictionary
的文档说:
参考书提供了用于管理字典的基本界面.
The basic interface for managing dictionaries is provided by
CFDictionary
Reference.
... which leads you to CFDictionaryGetValue()
.
这篇关于如何从CFMutableDictionary中检索特定键的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文