开发者

How to modify only one Key-Value pair in an NSMutableDictionnary

If I have an NSMutableDictionnary with 4 Key Value pairs (stored in a .plist), When I load the dictionary from the .plist how can I开发者_开发知识库 modify only one of the Key Value Pairs without erasing the rest?


You can change a single value for the given key like so:

[dict setValue:@"value" forKey:@"key"];


[dictionary setObject:value forKey:key] will assign the value for the specified key; [dictionary removeObjectForKey:key] will remove the key-value pair completely.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜