• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Circular references
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Circular references


  • Subject: Circular references
  • From: DKJ <email@hidden>
  • Date: Sun, 13 Sep 2009 15:00:57 -0700

I've got a MyViewController and a bunch of MySubview objects that are subviews of its view. I want MyViewController to keep track of certain things, such as the last MySubview that was clicked. So MySubview has to know about MyViewController to tell it it's been clicked; and MyViewController has to know about MySubview to define the property for the last-clicked subview.

But if I put this in MySubview.h:

   #import "MyViewController.h"

and this in MyViewController.h:

   #import "MySubview.h"

I get errors.

What's a good way to deal with this situation?

I know this must be a very basic question, but I don't even know what terms I should google to find out about it.

dkj
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Circular references
      • From: Jay Reynolds Freeman <email@hidden>
    • Re: Circular references
      • From: Joar Wingfors <email@hidden>
  • Prev by Date: Re: Mac Mini or iMac for Cocoa Development?
  • Next by Date: Re: Circular references
  • Previous by thread: Re: CALayer renderInContext not rendering all sublayers
  • Next by thread: Re: Circular references
  • Index(es):
    • Date
    • Thread