Before putting int value into dictionary i have set the int value as [NSNumber numberWithInt:2], now when i try to retrieve back the dictionary content , i want it back in int format.. hw to do this??
here's my code;
NSMutabelDictionary *dict = [[NSMutableDictionary alloc]init];
int intValue = 300;
[dict setObject:[NSNumber numberWithInt:intValue] forKey:@"integer"];
retriving.........
int number = [dict ObjectForKey:@"integer"];
.. it throws an exception sayin casting is required.. when i do it this way..
int number = (int)[dict ObjectForKey:@"integer"];
stil it doesnt work...
how to solve this problem?/
please suggest..