如何查找差价合约
How to do look ups on the CFDictionary
可能的重复项:
如何从 CFMutableDictionary 中检索特定键的值
在C++:
typedef struct
{
unsigned short wId;
bool bPersists;
unsigned short uPeriod;
bool bStop;
}stTimer;
unsigned short wId;
stTimer pEvent;
CTypedPtrMap<CMapWordToPtr,WORD,stTimer*>m_cIdMap;
if(m_cIdMap.Lookup(wId,pEvent))
{
//find and remove the event pEvent;
}
我需要将相同的功能移植到 Objective-C
我可以设置值并将其放入CFDictionary
,但我需要使用wId
(键)和pEvent
(值)查找字典。
您可以使用 NSDictionary 并使用 NSNumber 将键装箱(假设您已经创建了一个类来表示您的 stTimer 结构。
[myDictionary setObject: myStTimer forKey: [NSNumber numberWithUnsignedInt: [myStTimer wId]]];
StTimer* mySTTimer = [myDictionary objectForKey: [NSNumber numberWithUnsignedInt: anId]];
我认为使用较低级别的接口没有任何意义。 您不妨坚持使用C++版本。
相关文章:
- 正在查找文档以获得PS4平台的C++中的设备信息
- 在C++中查找文件
- 模板元程序查找相似的连续类型名称
- 在UNIX系统中使用DIR查找文件的字节大小
- 查找最接近的大于当前数字的数字的索引
- 有没有一种方法可以创建一个带有哈希表的数据库,该哈希表具有恒定时间查找功能
- 查找后更改类变量
- 使用正则表达式regex_search在字符串中查找字符串
- 使用gcc从静态链接的文件中查找可选符号
- 在C++中查找范围的长度
- 算法问题:查找从堆栈中弹出的所有序列
- 在Windows中查找扬声器输出的当前音量级别
- 如何在C++中使用X509证书模在令牌中查找私钥
- 使用.find函数在c++中查找字符和另一个字符之间的大小
- 在 Windows 上,是否可以让 dll 在不使用 PATH 环境变量的情况下在另一个文件夹中查找依赖项?
- 在 for 循环中查找问题时遇到困难
- 设置::查找和查找之间的性能差异<algorithm>
- 联合查找算法(查找周期),不使用 malloc
- 无法使用查找窗口查找窗口
- clang与gcc在查找声明方面有何不同