I'm stumped. I have an NSMutableDictionary w/ nested dictionaries that I am enumerating through to create an Array of a particular key value in a nested dictionary, but I want to exlude two "keys".
I am able to do it if I exclude one key, but as soon as I try to use the "||" or operator in my If statement it stops working and just adds all the objects to my new array, instead of all objects, but the two I'm trying to filter out.
My enumerating logic:
for (NSString *key in self.myMutDictionary) {
theBool = [key isEqualToString:@"First"];
NSLog(@"Is key = to First? %@", (theBool ? @"YES" : @"NO"));
if ((![key isEqualToString:@"First"]) || (![key isEqualToString:@"Second"])) {
newDict = [self.myMutDictionary objectForKey:key];
[self.filteredArray addObject:[newDict objectForKey:@"Third"]];
NSLog(@"Filtered Array: %@", self.filteredArray);
}}
Thanks for your help!