Simple Object Interaction Question

Discussion in 'Mac Programming' started by tjhopkins224, Mar 27, 2008.

  1. tjhopkins224
    Expand Collapse
    macrumors newbie

    Mar 27, 2008
    What is the best way to handle this simple problem in Obj-C?

    ObjectA creates an instance of ObjectB and is free to get and set properties of ObjectB. How can ObjectB similarly reference and send messages back to ObjectA (other than returning data from methods specifically called by Object A)?

    Thanks for your time.
  2. lee1210
    Expand Collapse
    macrumors 68040


    Jan 10, 2005
    Dallas, TX
    Have a constructor for ObjectB that takes a pointer to the type of ObjectA, and have ObjectA pass in self when it instantiates ObjectB?

  3. tjhopkins224
    Expand Collapse
    thread starter macrumors newbie

    Mar 27, 2008

Share This Page