@interface CustomObject ()

@property (strong, nonatomic) NSMutableDictionary *arbitraryKeyValuePairs;

@end

@implementation CustomObject

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if (!self.arbitraryKeyValuePairs) {
        self.arbitraryKeyValuePairs = [NSMutableDictionary dictionary];
    }

    self.arbitraryKeyValuePairs[key] = value;
}

- (id)valueForUndefinedKey:(NSString *)key
{
    NSArray *allKeys = [self.arbitraryKeyValuePairs allKeys];

    if ([allKeys containsObject:key]) {
        return self.arbitraryKeyValuePairs[key];
    } else {
        return [super valueForUndefinedKey:key];
    }
}

@end