Re: Setting up a main menu in a NIB(XIB)?
Re: Setting up a main menu in a NIB(XIB)?
- Subject: Re: Setting up a main menu in a NIB(XIB)?
- From: "Michael Ash" <email@hidden>
- Date: Wed, 12 Nov 2008 13:54:53 -0500
On Wed, Nov 12, 2008 at 1:37 PM, Russ <email@hidden> wrote:
>>It might be that your application doesn't use NSApplicationMain() as the program starting point.This
> function is responsible for initializing stuff and loading the main
> bundle's main nib file as specified in the Info.plist file.
>
> Correct, I do not use it. Use NSApplication's sharedApplication and run. I had seen something (a flowchart, I think) that said run would do the nib-loading also, which I found puzzling, but other docs do say the nib gets loaded before the run.
I'd recommend starting from a basic proof of concept and then figuring
out what you're doing differently. For example, I create a new "Cocoa
Application" project in Xcode and then replace its main() with this:
int main(int argc, char *argv[])
{
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@"MainMenu" owner:NSApp];
[NSApp run];
return 0;
}
And everything still works just as it did with NSApplicationMain(). So
whatever isn't working for you, figured out what's different from the
above, and fix it.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden