NSMutableDictionary setValue
- (void)setValue:(id)value forKey:(NSString *)key
Parameters of [NSMutableDictionary setValue]
value
The value for key.
key
The key for value. Note that when using key-value coding, the key must be a string (see “Key-Value Coding Fundamentals”).
Discussion of [NSMutableDictionary setValue]
This method adds value and key to the dictionary using setObject:forKey:, unless value is nil in which case the method instead attempts to remove key using removeObjectForKey:.
NSMutableDictionary setValue example.
NSMutableDictionary *parameters = [[NSMutableDictionary alloc] init];
[parameters setValue:[NSNumber numberWithBool:news] forKey:@"news"];
[parameters setValue:[NSNumber numberWithBool:mails] forKey:@"mails"];
[parameters setValue:[NSNumber numberWithBool:news] forKey:@"news"];
[parameters setValue:[NSNumber numberWithBool:mails] forKey:@"mails"];