importing MyDocument.h compiler errors and warnings
importing MyDocument.h compiler errors and warnings
- Subject: importing MyDocument.h compiler errors and warnings
- From: Derrek Leute <email@hidden>
- Date: Tue, 17 Oct 2006 17:52:28 -0400
In my objects I need to know the document they belong to. To
accomplish this, I created a reference to the currentDocument upon
the object initialization. Simplified Code:
@interface TreeWrapper : NSObject
{
NSDocument *document;
}
- (id) init
{
self = [super init];
if (self != nil) {
document = [[NSDocumentController sharedDocumentController]
currentDocument];
}
return self;
}
This works fine except it generates compiler warnings as I try and
call methods that are custom to my subclass of NSDocument. The
program compiles and runs as expected though.
If I switch it to MyDocument *document I need to also import
"MyDocument.h". This causes some sort of error where it can't find
the TreeWrapper which is the super class to my data objects.
"error: cannot find interface declaration for 'TreeWrapper',
superclass of '(one of my subclasses)'
It generates this for many of my data objects. The problem seems to
be that including MyDocument.h reincludes my root data object which
is a sub class of TreeWrapper.
Anyone have any ideas?
--Derrek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden