Re: Bilingual shenanigans
Re: Bilingual shenanigans
- Subject: Re: Bilingual shenanigans
- From: "David W. Halliday" <email@hidden>
- Date: Fri, 13 Sep 2002 14:30:41 -0500
- Organization: TNRCC
Dean Tresner wrote:
>
I am writing a cocoa app with four class files of the form:
>
>
Pretty.m
>
Plain.mm
>
Ugly.cpp
>
Uglier.cpp
>
>
Each of which has member variables of the class below. I can't seem to
>
get the right mix of #include, #import and forward declarations,
>
bouncing between compiler and linker errors. For instance, if the
>
header files look like:
>
>
Pretty.h:
>
@class Plain;
>
@interface Pretty : NSObject {
>
Plain *x;
>
...
>
>
Plain.h:
>
class Ugly;
>
@interface Plain : NSObject {
>
Ugly y;
>
...
I don't know... Does Objective-C++ allow Objective-C classes to have instance
variables that are C++ instances, as opposed to pointers to C++ instances? Or,
similarly, will Objective-C++ allow Objective-C classes to have instance variables
that are structures, as opposed to pointers to structures? (Of course all this
assumes that Pretty.h will be included only in an Objective-C or Objective-C++
context, that Plain.h will only be included in an Objective-C++ context, and Ugly.h
will only be included in an Objective-C++ or C++ context.)
>
Ugly.h:
>
class Uglier;
>
class Ugly {
>
Uglier z;
>
...
>
>
the compiler will tell me "y has incomplete type." If I put the
>
#include directives in the .h files to avoid the forward declarations,
>
things get even more confusing for both me and the compiler. What's the
>
right way to do this?
>
>
Dean
email@hidden
_______________________________________________
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.