如何从CFMutableDictionary中检索特定键的值 [英] How to retrieve the values for the particular key from CFMutableDictionary

查看:207
本文介绍了如何从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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆