You can achieve a lot by using protocols and "has_a"-relationships, instead of inheritance's "is_a"-relationships.
One very common pattern is delegate, but protocols are also useful for forwarding methods calls to encapsulated or wrapped objects.
in the following example to classes, that are not related to each other, share a common object, but it is also possible, that objects of the same kind use objects of different classes, that all implement a common protocol, so equal objects could do very different stuff.
@interface ClassA : NSObject
@property (strong) id<BrainProtocol> *brain
@end
@@implementation ClassA
@synthezise brain;
-(void)theMethod
{
[brain theMethod];
}
@end
@interface ClassB : NSObject
@property (strong) id<BrainProtocol> *brain
@end
@@implementation ClassB
@synthezise brain;
-(void)theMethod
{
[brain theMethod];
}
@end
ClassA *a = [[ClassA alloc] init];
ClassB *b = [[ClassB alloc] init];
//A object, that implements the BrainProtocol
Brain *brain = [[brain alloc] init];
[a setBrain:brain];
[b setBrain:brain];