Re: Inter-Object Reference
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.