• 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
Re: Inter-Object Reference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inter-Object Reference


  • Subject: Re: Inter-Object Reference
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Sat, 10 Jan 2004 14:32:10 +0100

At 5:58 Uhr -0500 10.01.2004, Joannou Ng wrote:
I have two objects that need to refer to each other like so:

#import <Foundation/Foundation.h>
#import "Second.h"
@interface First : NSObject {
Second *second;
}
@end

#import <Foundation/Foundation.h>
#import "First.h"
@interface Second : NSObject {
First *first;
}
@end

Obviously, it doesn't work.

Question is, how do I go about it then?

Read the ObjC book on Apple's web site, especially the part about @class. That should get you going. :-)

Note: Do *not* have each object retain the other, or they'll forever be united in undying love...
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Inter-Object Reference (From: Joannou Ng <email@hidden>)

  • Prev by Date: Re: Converting encodingName to NSStringEncoding
  • Next by Date: Re: vImage
  • Previous by thread: Inter-Object Reference
  • Next by thread: hash and isEqual not working as expected
  • Index(es):
    • Date
    • Thread