Re: References to classess
Re: References to classess
- Subject: Re: References to classess
- From: "Al Kirkus" <email@hidden>
- Date: Thu, 25 Apr 2002 20:15:42 -0500
Since this turned out to be a missing import in the imlementation file (dooh!!) it is now fixed but just FYI. The error message is generated at a point where an instance object of the class Column is being retained. The compiler knows the class of the object and points out the error identifying the class of the object.
See ya, Al
>
>> Ben Kennedy <email@hidden> - 4/25/02 2:53 PM >>>
On 25,04,02 at 3:29 pm -0400, 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 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.
First of all, you usually retain and release instances of classes, not
class objects themselves, so it sounds like you have something fishy
going on in your code there.
However, you should be able to make the mutual referencing work by using
a forward declaration in the header file and importing the full header in
the implementation file, ` la:
// in ClassA.h:
@class ClassB;
@interface ClassA // ....
// in ClassA.m:
#import "ClassB.h"
@implementation ClassA // ....
I do this in several places and it works well.
-ben
--
Ben Kennedy, chief magician
zygoat creative technical services
613-228-3392 | 1-866-466-4628
http://www.zygoat.ca
_______________________________________________
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.