Re: How to load a special nib file in cocoa?
Re: How to load a special nib file in cocoa?
- Subject: Re: How to load a special nib file in cocoa?
- From: 魏立群(Gordon.Wei) <email@hidden>
- Date: Fri, 17 Feb 2006 16:30:07 +0800
----- 原始邮件 -----
发件人: Omar Qazi
收件人: 魏立群(Gordon.Wei)
抄送: email@hidden
发送时间: 2006年2月17日 14:26
主题: Re: How to load a special nib file in cocoa?
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)
[myMenu addItemWithTitle:@"test" action:TestOne keyEquivalent:NSF15FunctionKey];
How to implement one action method?
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