Reputation: 38940
If I have a dictionary with the following key/value "foo"/"bar" and declared [dictionary setObject:@"baz" forKey:@"foo"];
would this replace the current key value pair with "foo"/"baz" and delete "foo"/"bar"?
Upvotes: 13
Views: 9682
Reputation: 162
The behave of an NSMutableDictionary (as any common hash table) is that if it does not exists it creates a new key/value pair, if it already exits it will replace the existing value with the new one.
Upvotes: 8
Reputation: 3358
The documentation here;
suggests that it would. But please, don't take my word for it, read them yourself.
Perhaps you should also read;
Upvotes: 2