I need to get the value for the particular key in the map,
id val = [m_cAppIdMap valueForKey:wTimerIds];
where wTimerIds is a unsigned short integer.
Runtime exception:EXC_BAD_ACCESS
Warning: passing argument 1 of
‘valueForKey:’ makes pointer from
integer without a cast
EDITED:
NSNumber* val = [m_cAppIdMap valueForKey:[NSNumber numberWithUnsignedShort:wTimerIds]];
The warning i’m getting is,
incompatible Objective-C types ‘struct NSNumber *’, expected ‘struct NSString *’ when
passing argument 1 of ‘valueForKey:’ from distinct Objective-C type
The runtime exception i’m getting is,
[NSCFNumber length]: unrecognized selector sent to instance 0x100110c20
I am storing the the key as a unsignedshort in the dictioanry.so i’m trying to search for the value in the dictionary with that data type.
You should use