Say you have several objects "A," "B," "C," which contain
references to each other in an NSArray. Is it possible inside each
object's doSomethingAmazing method to determine which object called
it? For example: Say Object C receives a doSomethingAmazing
invocation. It should do its thing and then notify it's siblings to
run their own doSomethingAmazing methods but because each contains
references to all the others, it could enter an infinite loop.
Here's an example:
Hi Ken,
I actually asked this question a few weeks ago. The general consenous
is that it is not possible within the constructs of the language.
However, you can add a "sender" parameter to your methods to get the
same result. For example...