1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Simple Object Interaction Question

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

  1. macrumors newbie

    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. macrumors 68040


    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. macrumors newbie


    Got it -- thanks for your help.

Share This Page