Newbie question: instantiate a class in its header file OR in IB
Newbie question: instantiate a class in its header file OR in IB
- Subject: Newbie question: instantiate a class in its header file OR in IB
- From: JArod Wen <email@hidden>
- Date: Tue, 24 Jun 2008 23:34:19 -0400
Hi Gurus,
I am a cocoa newbie from Java. Recently I found an example code in
which the instance of a class is defined in its own class's header
file, as following:
@interface AppController : NSObject {
// Instance variables here
}
AppController *appController;
And then this head file will be imported in MyDocument.h(there are
methods using appController in MyDocument.m).
I am a little bit confused by this code. Since always we will create
the controller in IB and then I think the instance will be created by
IB, right? So is there any advanced features/reasons for this kind of
usage?
In my opinion, I'd like to have a line of
IBOutlet AppController *appController;
in my MyDocument.h and then connect it with the appController in IB.
Which implementation will be preferred by you?
Thanks in advance for any instructions!
---------------
JArod Wen
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden