"this class is not key value coding-compliant for the key"

ios, objective-c

Solution

I think this is a combination of using `NSDictionary` when you mean `NSMutableDictionary`, and sending the message `setValue` when `setObject` is generally considered more appropriate. See this question for details:

NSDictionary setValue:forKey: -- getting "this class is not key value coding-compliant for the key"

Problem

I feel like I'm missing something obvious here but I'm new to obj-c so maybe it's just something I'm not aware of. I'm getting the exception error at runtime... NSDictionaryI 0x9d384d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key overObject.' On the 4th line of this code... ``` NSDictionary *tempDictionary = [[NSDictionary alloc] init]; Boolean overObjectYES = NO; Boolean overObjectNo = NO; [tempDictionary setValue:[NSNumber numberWithBool:overObjectYES] forKey:@"overObject"]; ```

Original source

Related problems