Re: [newbie] Cyclic #import
Re: [newbie] Cyclic #import
- Subject: Re: [newbie] Cyclic #import
- From: Thomas Davie <email@hidden>
- Date: Wed, 8 Dec 2004 04:20:19 +0000
On 8 Dec 2004, at 04:13, King Chung Huang wrote:
In your header (.h) files, you can just prototype the class, then
import the actual header in your implementation (.m) files as needed.
For example, in MyController.h, you would write:
#import <Cocoa/Cocoa.h>
@class MyNetworker;
@interface MyController : NSObject {
IBOutlet MyNetworker *networker;
}
A good tip here is to have a generic header file that you include from
all your .m files. This file contains something along the lines of:
#import "Something1.h"
#import "SomethingElse.h"
etc for each of your classes.
This way you don't need to worry about getting your header imports in
the correct order in each of your .m files, you just need to include
your project.h file.
This can lead to a lot of extra code being included in each .m file,
but the gnu C compiler has a dead code stripper IIRC so it should strip
out all of this extra code.
Bob
_______________________________________________
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