I need to create an object in one class hierarchy that wraps an object from a different one. They both have very similar interfaces, and I'd like to automatically have my wrapper forward messages it doesn't recognize to its target in lieu of implementing its own properties. I got this to work using something like this:
- (id)forwardingTargetForSelector:(SEL)sel { if ([self.wrappedObject respondsToSelector:sel]) return self.wrappedObject; return self; }
But this doesn't work for key-value coding. How can I go about having my wrapper implement key-value coding in a way that uses the properties of its wrapped object?