I’m using NSLog(@"%@", [filter attributes]); to print out the following from a dictionary:
CIAttributeFilterDisplayName = "Color Controls";
CIAttributeFilterName = CIColorControls;
inputBrightness = {
CIAttributeClass = NSNumber;
CIAttributeDefault = 0;
CIAttributeIdentity = 0;
CIAttributeSliderMax = 1;
CIAttributeSliderMin = "-1";
CIAttributeType = CIAttributeTypeScalar;
};
I’m a little confused about NSDictionarys and how the information is organized. If I needed to access the attributes for inputBrightness, what would be the syntax to retrieve this form the dictionary?
If you want to retrieve
inputBrightnessfrom dictionaryfilter, you can try this:This will return another dictionary with key value pairs
CIAttributeClass:NSNumber,CIAttributeDefault:0etc..You can confirm that
filter[@"inputBrightness"]is a dictionary by looking at the NSLog statement. Key value pairs enclosed in{and}represents a dictionary where as(and)represents an array.Inorder to retrieve any value from
inputBrightnessDictyou can fetch it as,inputBrightnessDict[@"CIAttributeType"];