Skip to content

Instantly share code, notes, and snippets.

@fjolnir
Created September 7, 2014 09:48
Show Gist options
  • Save fjolnir/7412e8a8926d83d81fad to your computer and use it in GitHub Desktop.
Save fjolnir/7412e8a8926d83d81fad to your computer and use it in GitHub Desktop.
- (id)forwardingTargetForSelector:(SEL const)aSelector
{
if( aSelector == @selector(a)
|| aSelector == @selector(b)
|| aSelector == @selector(c))
return _wrappedObject;
else
return nil;
}
- (void)setValue:(id const)aValue forUndefinedKey:(NSString * const)aKey
{
@try {
[_wrappedObject setValue:aValue forKey:aKey];
} @catch(NSException *ignored) {
[super setValue:aValue forUndefinedKey:aKey];
}
}
- (id)valueForUndefinedKey:(NSString * const)aKey
{
@try {
return [_wrappedObject valueForKey:aKey];
} @catch(NSException *ignored) {
return [super valueForUndefinedKey:aKey];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment