NSMutableDictionary-Error in setting the key value pairs on to the dictionary
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;
精彩评论