Re: Interface builder and instances
Re: Interface builder and instances
- Subject: Re: Interface builder and instances
- From: zauhar <email@hidden>
- Date: Sun, 4 May 2003 11:43:18 -0400
Pierre, your window controller can be instantiated in your code this
way (example from my code):
@implementation atomSelectorController
- (id) init
{
self = [ super initWithWindowNibName:@"atomSelector" ] ;
(etc etc)
The main controller causes the "Atom Selector" window to appear in
response to a user menu selection this way:
if( ! theAtomSelector )
{
theAtomSelector = [ [ atomSelectorController alloc ]
init ] ;
}
There is a nib file, atomSelector.nib, which contains the window being
controlled, and the File's Owner of which is set to the custom class
atomSelectorController.
Hope that is helpful,
Randy
On Sunday, May 4, 2003, at 09:04 AM, Pierre DOUCY wrote:
>
I'm a newbie in Obj-C/Cocoa programming and there are some things that
>
I don't understand with the Interface Builder instantiates classes.
>
>
Practically, let's say that I want to create an application containing
>
a lot of different windows, complicated enough to let me decide that
>
I'm going to use one controller class per window. The way to do it -as
>
far as I know- is to create a so-called custom classes derivated from
>
NSObject and implement some methods in them. I will then instantiate
>
them in IB and make connections.
>
>
That's where I don't understand what's happening: I don't see any code
>
that does these instantiations. What if I want to instantiate my
>
controllers dynamically depending on the user's actions, and maybe
>
dynamically create connections between controls and methods (for
>
example if I programmatically add a control into my window) ?
>
>
Thanks in advance.
>
>
Pierre DOUCY
>
--
>
Cats are intended to teach us that not everything in nature has a
>
function.
>
_______________________________________________
>
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.
>
>
Randy J. Zauhar, PhD
Assoc. Prof. of Biochemistry
Director, Graduate Program in Bioinformatics
Dept. of Chemistry & Biochemistry
University of the Sciences in Philadelphia
600 S. 43rd Street
Philadelphia, PA 19104
Phone: (215)596-8691
FAX: (215)596-8543
E-mail: email@hidden
Web:
http://tonga.usip.edu/zauhar
Discussion after watching Disney's "Lilo & Stitch":
DAD: "But why did the space aliens speak English, as opposed to French,
or Swahili? And why did the one alien speak English with an Eastern
European accent? I don't get it."
CATHERINE (age 7): "That's 'cause you don't have a good cartoon brain."
_______________________________________________
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.