Get an object called a method

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)?

+7
source share
1 answer

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.

+7
source

All Articles