Objective-C Language NSDictionary to NSData


Example

NSDictionary *myDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil];  
NSData *myData = [NSKeyedArchiver archivedDataWithRootObject:myDictionary];

Reserve path:

NSDictionary *myDictionary = (NSDictionary*) [NSKeyedUnarchiver unarchiveObjectWithData:myData];