• 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
importing MyDocument.h compiler errors and warnings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: importing MyDocument.h compiler errors and warnings
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: NSToolbar with NSSearchField crash
  • Next by Date: Re: NSToolbar with NSSearchField crash
  • Previous by thread: Re: NSToolbar with NSSearchField crash
  • Next by thread: Re: importing MyDocument.h compiler errors and warnings
  • Index(es):
    • Date
    • Thread