• 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: Preferences in a separate nib file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preferences in a separate nib file


  • Subject: Re: Preferences in a separate nib file
  • From: Cameron Hayne <email@hidden>
  • Date: Sat, 5 Nov 2005 18:50:50 -0500

On 5-Nov-05, at 11:44 AM, Derrick Bass wrote:

In particular, the example directly connects the Preferences menu item to the makeKeyAndOrderFront: action of the preference window. So how would I do that if the main menu and preference panel are in separate nib files? Is there a "no code" way to do this, or is the price of a separate nib having to write some code to connect things up?

I think you need some code to hook it up to your main controller.
For example, here is what I have in the main controller of my document-based app that has a preferences window in a separate nib that is loaded by its own preferences controller.


- (IBAction)showPreferences:(id)sender
{
    NSLog(@"IsingController.showPreferences");
    if (preferencesCtl == nil)
    {
        preferencesCtl = [[IsingPreferencesCtl alloc] init];
    }

    [[preferencesCtl window] makeKeyAndOrderFront: self];
}

--
Cameron Hayne
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
References: 
 >Preferences in a separate nib file (From: Derrick Bass <email@hidden>)

  • Prev by Date: sheets and undo
  • Next by Date: Re: multiple documents in an app
  • Previous by thread: Re: Preferences in a separate nib file
  • Next by thread: Re: Preferences in a separate nib file
  • Index(es):
    • Date
    • Thread