I have a class that looks like this:
@interface Properties : NSObject { @private NSNumber* prop1; NSNumberBool* prop2;
where NSNumberBool is typedef:
// in MyApp_Prefix.pch typedef NSNumber NSNumberBool;
I have all the necessary @property and @synthesize declarations to create prop1 and prop2 properties.
Everything compiled and worked fine until I tried to access prop2 using [myProperties valueForKey: @ "prop2"]. This gives me the error "class is not key-value compliant". However, many of these calls work fine:
myProperties.prop2; //works [myProperties prop2]; //works [myProperties valueForKey:@"prop1"]; //works [myProperties valueForKey:@"prop2"] // throws NSUnknownKeyException ??
What is going on here and how can I fix it?
Thanks,
objective-c typedef key-value-coding
tba
source share