NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"value 1", @"value 2", nil] forKeys:[NSArray arrayWithObjects:@"key 1", @"key 2", nil]]; NSString *dictionaryString = [dictionary description]; NSLog(@"%@", dictionaryString); NSDictionary *d = [dictionaryString propertyList]; NSLog(@"%@", [d objectForKey:@"key 2"]);
Please note that Apple reports
/ * These methods are no longer recommended because they do not work with property lists and string files in binary plist format. Use the API in NSPropertyList.h instead. * /
However, if you know or can confirm that you are not transmitting the binary format, this should work without problems.
source share