Re: Newbie #import confusion...
Re: Newbie #import confusion...
- Subject: Re: Newbie #import confusion...
- From: j o a r <email@hidden>
- Date: Wed, 28 Dec 2005 11:38:34 +0100
Use the "@class" directive:
===============
@class MyCustomView; // Note that class names always begins with a
capital letter!
@interface Foo : NSObject
{
@private
IBOutlet MyCustomView *aView;
}
@end
===============
More information to be found in the ObjC documentation, and in the
list archives.
j o a r
On 28 dec 2005, at 11.27, Matt Reagan wrote:
Can anyone please help me out? The answer to this is so amazingly
simple that I can't seem to find it anywhere...
I have a controller object with an outlet pointing to a NSView
subclass, and that NSView has an outlet pointing back to the
controller. My problem is that because the IBOutlet declartions are
typed to these specific classes, I have to #import each header so the
compiler can see what it needs to compile, but I'm getting some kind
of circular problem where the NSView's source imports the controller's
header, which in turn imports the view's header, and round and round
it goes. So I get a compile error. In the NSView's source code,
changing this declaration:
IBOutlet myCustomView *theView;
to this:
IBOutlet id *theView;
will allow it to compile, but obviously there must be some way to
avoid this problem without having to get rid of the class typing.
Can someone shove my nose into the obvious solution for this?
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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