I am trying to figure out (if possible) how to read through NSDictionay key/values with a switch statement instead of a for loop.
currently I am doing this
for (id key in seriesData) {
NSLog(@"key: %@, value: %@", key, [seriesData objectForKey:key]);
}
However I would like it to be a switch statement where I look for the key, if the key is found then i put that value into a variable i will use later.
hope this makes sense, any help would be greatly appreciated.
The C
switchstatement only applies to integer-like keys (which includesenum). It is not possible to useswitchwith Objective-C objects, such as those found in anNSDictionary.