2011-05-24 97 views
0

我收到以下代码的错误。NSMutableDictionary-将键值对设置为字典时出错

@interface event : NSObject 
{ 
NSMutableDictionary m_cAppIdMap; //error:statically allocated instance of Objective C 
} 
@end 

我通过函数create在事件实现中将对象设置为字典。

[m_cAppIdMap setObject:pEvent forKey:[NSNumber numberWithUnsignedInt:wTimerId]]; //Error:Cannot convert to a pointer type 

这是我设置结构对象到字典上的方式。 pEvent是包含5个字段的结构,wTimerId是无符号短整数(键)。

回答

5

你的伊娃应该是一个指针。

NSMutableDictionary* m_cAppIdMap; 
相关问题