Quote:
Originally Posted by neduhamel
So the class B does NOT inherit from class A, but it is a subclass (is this the right term?) of the class A.
|
If class B does not inherit from class A, then "subclass" is probably not the right word. Subclass would imply, to me, that B inherits from A. Let's say they have a parent-child relationship instead.
If class B only needs to know its parent in a certain method, you could pass the parent into that method. Otherwise, if B needs to contact its parent a lot, you could give class B an instance variable called "parent" , and write an initWithParent: method that sets the parent variable. If the parent changes a lot, you should probably make b.parent a property instead.