getting the calling object

  • Hello,

    Quickie: I've tried searching the archives and the docs, but I'm
    unable to come up with a successful search string for my question. In
    Cocoa, is there a mechanism for determining the caller of a method?
    Or does that have to be included as a variable in the method?

    For example, if Parent calls a method of Child, is there a way for
    Child to determine who made the call? or would I have to pass the
    Parent's 'self'.

    thanks for any info,

    Jaime Magiera
    Sensory Research
    http://www.sensoryresearch.net
  • On Oct 3, 2007, at 2:11 PM, Jaime Magiera wrote:

    > Quickie: I've tried searching the archives and the docs, but I'm
    > unable to come up with a successful search string for my question.
    > In Cocoa, is there a mechanism for determining the caller of a method?

    No.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • > Quickie: I've tried searching the archives and the docs, but I'm
    > unable to come up with a successful search string for my question. In
    > Cocoa, is there a mechanism for determining the caller of a method?
    > Or does that have to be included as a variable in the method?

      You've correclty guessed that you'd have to pass 'self' as an
    argument when messaging the other object. If the other object's method
    does not allow for a 'sender', you're out of luck.

    --
    I.S.
  • Ok, thanks guys!

    These are methods of my own, so I'll add a sender parameter.

    On Oct 3, 2007, at 4:27 PM, I. Savant wrote:

    > You've correclty guessed that you'd have to pass 'self' as an
    > argument when messaging the other object. If the other object's method
    > does not allow for a 'sender', you're out of luck.

    On Oct 3, 2007, at 4:26 PM, Nick Zitzmann wrote:
    >
    > No.

    Jaime Magiera
    Sensory Research
    http://www.sensoryresearch.net
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today