I have map my data in a NSDictionary. The data is mapped with one key and multiple values.
NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
int count = 1;
int intval2 = 222;
[dict setObject:[NSString stringWithFormat:@"%d,%d",intval,intval2]
First thing first you can not addObject(this method is for NSMutableArray) into dictionay, You can setObject or Setvalue for any key.
If you are inserting record same as above and there are two integers separated by comma only than you can get it using below way:
NSString *myBothvalue = [dict valueForKey:@"count"]; NSArray *temp = [myBothvalue componentsSeparatedByString:@","]; NSInteger value1 = [[temp objectAtIndex:0] integerValue]; NSInteger value2 = [[temp objectAtIndex:1] integerValue];
Hope this will help you.