Re: Versioning MainMenu.nib
Re: Versioning MainMenu.nib
- Subject: Re: Versioning MainMenu.nib
- From: Jim Puls <email@hidden>
- Date: Wed, 4 Jun 2008 08:23:43 -0700
On Jun 3, 2008, at 8:12 PM, Chris Outwin wrote:
I have MainMenu.nib and MainMenu(Debug).nib in a Cocoa document app
using Xcode 3.0. The (Debug)version has controls only used during
development. I am trying to use build settings to dynamically load
the MainMenu(Debug).nib when PreprocessorMacros has a value
associated with the debug configuration.
The only example I've found is AppeanceSample: a Carbon app which
does not have <key>NSMainNibFile</key> <string>MainMenu</string> in
the Info.plist. This key/value pair may be my problem.
How do you dynamically select between two version of MainMenu.nib in
a Cocoa document app?
Check the very beginning of the docs for NSApplication:
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#/
/apple_ref/doc/uid/20000012-800060
Every application must have exactly one instance of NSApplication
(or a subclass of NSApplication). Your program’s main() function
should create this instance by invoking the sharedApplication class
method. After creating the NSApplication object, the main() function
should load your application’s main nib file and then start the
event loop by sending the NSApplication object a run message. If you
create an Application project in Xcode, this main() function is
created for you. The main() function Xcode creates begins by calling
a function named NSApplicationMain(), which is functionally similar
to the following:
void NSApplicationMain(int argc, char *argv[]) {
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@"myMain" owner:NSApp];
[NSApp run];
}
-> jp
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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