• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
newbie: adding nibs: i'm stuck
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

newbie: adding nibs: i'm stuck


  • Subject: newbie: adding nibs: i'm stuck
  • From: George Greene <email@hidden>
  • Date: Fri, 4 Nov 2005 06:23:08 -0500

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


  • Follow-Ups:
    • Re: newbie: adding nibs: i'm stuck
      • From: George Greene <email@hidden>
  • Prev by Date: Catch an exception
  • Next by Date: Re: Two questions on CoreData
  • Previous by thread: Re: Catch an exception
  • Next by thread: Re: newbie: adding nibs: i'm stuck
  • Index(es):
    • Date
    • Thread