Category:1984 births
Category:Living people
Category:Punjabi singers
Category:People from Jalandhar
Category:Singers from Punjab, IndiaQ:
Return IOS5 keychain values from NSDictionary
I have a dictionary like this one :
NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
@"e1",kKey1,
@"e2",kKey2,
nil];
NSLog(@"%@",[dictionary description]);
That return :
{
kKey1 = "e1";
kKey2 = "e2";
}
But I want to change the format to be :
{
e1 = "e1";
e2 = "e2";
}
I can't found anything that can do this.
A:
Take a look at JSON (JSON is very similar to dicts)
[NSJSONSerialization dataWithJSONObject:dictionary options:kNilOptions error:nil];
A:
You could do a little refactoring to give yourself an entry for each key:
NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSString stringWithFormat:@"%@=%@",kKey1,@"e1"],kKey1,
[NSString stringWithFormat ac619d1d87
Related links:
Comments