• 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
Re: How to load a special nib file in cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to load a special nib file in cocoa?


  • Subject: Re: How to load a special nib file in cocoa?
  • From: Omar Qazi <email@hidden>
  • Date: Thu, 16 Feb 2006 22:26:58 -0800

Then just add it to the awakeFromNib method

i.e.

- (void)awakeFromNib
{
	//...Do Anything you need to do before loading the nib here

	[NSBundle loadNibNamed:@"Your Nib" owner:NSApp];
}

As for dyanamically adding a menu and set ing an action:

1. Create an IBOutlet to your main NSMenu

2. Call addMenuItem: action: keyEquivilent: (or something like that, use CodeSense to figure it out)


On Feb 16, 2006, at 10:07 PM, 魏立群(Gordon.Wei) wrote:

Yes , I have.
@interface MyObject : NSObject
{
}
- (void)awakeFromNib;
@end


----- 原始邮件 ----- 发件人: Omar Qazi 收件人: 魏立群(Gordon.Wei) 抄送: email@hidden 发送时间: 2006年2月17日 13:59 主题: Re: How to load a special nib file in cocoa?

Do you have any custom classes inside your Cocoa Applications main nib file?

On Feb 16, 2006, at 9:56 PM, 魏立群(Gordon.Wei) wrote:

Thanks.
But, where should I add this line?
I have built one simple cocoa application project, but I don't know how to add this line?


----- 原始邮件 -----
发件人: Omar Qazi
收件人: 魏立群(Gordon.Wei)
发送时间: 2006年2月17日 13:52
主题: Re: How to load a special nib file in cocoa?

[NSBundle loadNibNamed:@"YourNibName"];

On Feb 16, 2006, at 9:48 PM, 魏立群(Gordon.Wei) wrote:

> Hi, All developers,
> I have one problem that is how to load one special nib file in
> cocoa?
> Yes, I have create two nib files for my application, when the
> application
> starts it will check some device's status and to load one nib file.
> The other problem is how to add new sub menu item into currect
> menu dynamically.
> And how to make connection between the new sub menu item and the
> function?
>
> Thanks & best regards. _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> 40roflsoftware.com
>
> 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
  • Follow-Ups:
    • Re: How to load a special nib file in cocoa?
      • From: 魏立群(Gordon.Wei) <email@hidden>
    • Re: How to load a special nib file in cocoa?
      • From: j o a r <email@hidden>
    • Re: How to load a special nib file in cocoa?
      • From: 魏立群(Gordon.Wei) <email@hidden>
References: 
 >How to load a special nib file in cocoa? (From: 魏立群(Gordon.Wei) <email@hidden>)
 >Re: How to load a special nib file in cocoa? (From: Omar Qazi <email@hidden>)
 >Re: How to load a special nib file in cocoa? (From: 魏立群(Gordon.Wei) <email@hidden>)

  • Prev by Date: Re: How to load a special nib file in cocoa?
  • Next by Date: Re: resize text lines when nstextview is resized
  • Previous by thread: Re: How to load a special nib file in cocoa?
  • Next by thread: Re: How to load a special nib file in cocoa?
  • Index(es):
    • Date
    • Thread