开发者

NSMutableDictionary-Error in setting the key value pairs on to the dictionary

开发者 https://www.devze.com 2023-03-07 19:16 出处:网络
I am getting errors for the below code. @interface event : NSObject { NSMutableDictionarym_cAppIdMap;//error:statically allocated instance of Objective C

I am getting errors for the below code.

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

I am setting the object to the dictionary throug开发者_如何学编程h the function create in the event implementation.

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

This is the way i am setting a structure object on to the dictionary. pEvent is the structure containing 5 fields and wTimerId is the unsigned short integer(key).


Your ivar should be a pointer.

NSMutableDictionary*  m_cAppIdMap;
0

精彩评论

暂无评论...
验证码 换一张
取 消