0

For example, there are functions named -(void)Foo, and -(void)Foo:(id)sender.

The -(void)Foo:(id)sender can get the caller from parameter, and my question is, how to get caller from -(void)Foo? Is there any way to get the caller?

fejese
  • 4,601
  • 4
  • 29
  • 36
AechoLiu
  • 17,522
  • 9
  • 100
  • 118

1 Answers1

1

Please have a look at Objective C find caller of method. For what do you need it? The (id)sender parameter is passed directly by the method sending the message, there is no magic involved.

Community
  • 1
  • 1
Nick Weaver
  • 47,228
  • 12
  • 98
  • 108
  • Thank you any way. Because a custom control doesn't pass the self as the sender parameter, so I cannot get some information from the custom control. I will find another way to solve the problem. – AechoLiu May 20 '11 at 08:30