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?


Having extra menu items added to your debug builds is not an uncommon practice. Most of the time though, developers choose to not replace the whole menu, but rather just add a special "Debug" menu at the end of their regular menu bar.

You could load this debug menu from a nib file, but I would probably suggest that you just create and insert it programatically. See the API in NSApplication (for how to get a reference to the main menu), and the API in NSMenu & NSMenuItem (for how to create and insert the menu).

j o a r


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to