If I have a call from a random class, for example:
@implementation SomeClass - (void) classMethodFoo { int a = [SomeSingleton sharedInstance].aValue; } @end
Inside SomeSingleton sharedInstance , is there a way to get a reference to the object that called this method (without the called passing itself as a parameter, of course)?
SomeSingleton sharedInstance
No, caller information is not automatically transmitted.
This is why IBAction methods, for example, have a sender parameter and why delegate methods often have a parameter related to the delegation object.
IBAction
sender