I was a bit surprised at first that UIView
's drawing is helped by CALayer
, but CALayer
's delegate is actually UIView
. It seems that the relationship is reversed.
But is it true that, delegate has no "master commander" or "ownership" relationships... it can go any direction: such as, Class A can have a delegate which is Class B, and at the same time, Class B can also have a delegate that is Class A.
Even more, there can be multiple delegates, which means, an object needs help from several other objects.
It is kind of similar to the physical world, that a CTO can delegate the "Technical ability test to interview someone" to David, and now David is a delegate for providing a score of 1 to 10. But David can delegate a requirement met or not back to the CTO (a boolean) that "I can only interview the candidate for Javascript, I will agree the new candidate can be hired and agree to work with him if you find out he is good with scalability issues because our group need such a person" -- and David is delegating this back to the CTO.
So in Objective-C (and probably any language too), there can be multiple delegates, and they can go any direction, and the main idea is just for some "help" that the original object doesn't know how to handle. Is that true?