Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cyclic import dependency causes compilation errors



I have two classes which depend on each other. The LDAP attribute contains an array of LDAPAttributeValues. Each LDAPAttribute contains a reference to it's parent LDAPAttribute. Yet as soon as I compile this with the line #import "LDAPAttribute.h un-commented, I get an compilation error:

In file included from /Users/alex/Projects/AddressBook4LDAP/ LDAPObject.h:10,
from /Users/alex/Projects/AddressBook4LDAP/ Connector.h:13,
from /Users/alex/Projects/AddressBook4LDAP/ ABxLDAPController.h:13,
from /Users/alex/Projects/AddressBook4LDAP/ ABxLDAPController.m:9:
/Users/alex/Projects/AddressBook4LDAP/LDAPAttribute.h:21: error: parse error before 'LDAPAttributeValue'
/Users/alex/Projects/AddressBook4LDAP/LDAPAttribute.h:25: fatal error: method definition not in @implementation context
compilation terminated.
{standard input}:5:FATAL:.abort detected. Assembly stopping.


Here are the header :

#import <Cocoa/Cocoa.h>
#import "LDAPAttributeValue.h"

@interface LDAPAttribute : NSObject
{	
	@private
	NSString * name;
	NSMutableArray * values;
}

and

#import <Cocoa/Cocoa.h>
//#import "LDAPAttribute.h"

@interface LDAPAttributeValue : NSObject
{	
	@private
	NSString * value;
	//LDAPAttribute * parentAttribute;
}

Thanks
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.