【发布时间】:2014-11-05 10:12:16
【问题描述】:
我有一个NSString =@"KEY3"; 和一个NSMutableDictionary *AllValues ;,如下所示。我只需要检查字符串是否是 AllValues Dictionary 的元素之一
KEY1 {
MLCAvailable = "test";
MLCColorCode = "test2";
NotesCount = "test3";
},
KEY2 {
MLCAvailable = "test";
MLCColorCode = "test2";
NotesCount = "test3";
},
KEY3 {
MLCAvailable = "test";
MLCColorCode = "test2";
NotesCount = "test3";
},
KEY4 {
MLCAvailable = "test";
MLCColorCode = "test2";
NotesCount = "test3";
},
How should i find whether they KEY 3 is present in the given MutableDictionary ?
【问题讨论】:
-
if ([AllValues objectForKey:@"KEY3"]) { NSLog(@"YES"); }
标签: ios objective-c xcode nsmutabledictionary