Re: References to classess
Re: References to classess
- Subject: Re: References to classess
- From: Andy Lee <email@hidden>
- Date: Thu, 25 Apr 2002 16:13:09 -0400
At 2:29 PM -0500 4/25/02, Al Kirkus wrote:
I have a class structure in which one class uses another but the
other uses the first. I can get it to compile by using the @class
directive instead of including the one of the header files
Are you using #include or #import? You should use #import.
but I receive warnings like:
Record.m:27: warning: `Column' does not respond to `retain'
The Column class is the one I used @class on.
All the @class does is tell the compiler there exists a Column class.
You can use this to help compile a .h file that has Column instance
variables, if you don't want to (or can't) import the Column.h header.
To compile the .m file without warnings (as you should), you need to
import Column.h so the compiler knows what messages Column responds
to.
You can use
@class Column;
in your OtherClass.h file, and
#import "Column.h"
in your OtherClass.m file so the compiler will see what methods
Column responds to.
--Andy
_______________________________________________
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.