Re: newbie: adding nibs: i'm stuck
Re: newbie: adding nibs: i'm stuck
- Subject: Re: newbie: adding nibs: i'm stuck
- From: George Greene <email@hidden>
- Date: Fri, 4 Nov 2005 08:11:42 -0500
thanks everyone, but i think i've got it. maybe?
the controller needs an outlet to point to the user interface that it
controls. so in MyAboutController, i need an outlet that points to
the About panel, right?
so i need to rewrite my MyAboutController and my -showMyAboutPanel
method. right?
On Nov 4, 2005, at 6:23 AM, George Greene wrote:
i'm trying to add a nib to a program which must be called using
bundles. this problem is found in Hillegass' book, chapter 9.
i need to discuss what needs to happen. i'm missing something.
in this chapter, a preference panel is created. the problem calls
for a nib to be added and loaded when the "About Application" is
selected from the Application menu.
an appController is created. if i'm understanding this correctly,
please correct me if i'm not, the appController controls the
preference panel controller. the preference panel controller
receives message from the objects on the preference panel nib. i
hope i'm understanding that correctly. this is already done in the
book.
the task is to add a nib, for "About Application" and use bundles.
this is where i'm getting lost.
i created a MyAboutController. in appController, i create a method
called -showMyAboutPanel. i create a nib file using a panel from
IB and drag a system text font onto the panel. i saved the About
nib, but for some reason it did not ask me if it should be added to
the project. (XCode2) i tried to connect About Application to
File's Owner. ok that was wrong. i tried to connect it to the
AppController, but it was connected using a different method. i
disconnect that method. i was then able to connect it using the -
showAboutPanel. i have got to be wrong somewhere in here, right.
inside MyAboutController i defined the -init method as
- (id) init
{
NSBundle *myBundle = [NSBundle mainBundle];
[myBundle loadNibNamed: @"About" owner: myBundle];
return self;
}
in AppController i defined -showMyAboutPanel: (id)
{
if ( !myAboutController )
{
myAboutController = [[MyAboutController alloc] init];
}
[myAboutController makeKeyAndOrderFront:self];
}
there are no variable or method headed in MyAboutController.h file.
no outlet or method headers.
ok i know i'm wrong. where did i go wrong? what am i missing? how
should i approach adding a nib that will be displayed when i choose
something from the menu? Is it necessary to create a controller?
it seems like it should be a controller for each added nib. right?
thanks everyone,
g.
_______________________________________________
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
_______________________________________________
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