Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6560839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:30:47+00:00 2026-05-25T13:30:47+00:00

I have a nib that has a button that I would like the relevant

  • 0

I have a nib that has a button that I would like the relevant controller to have access to. But right now the owner is a generic NSViewController, and inside AppDelegate I assign the nib to the controller like:

[browseViewController initWithNibName:@"BrowseView" bundle:[NSBundle mainBundle]];

But is it possible within the nib file to assign a button’s referencing outlet generically? In other words, to give the outlet a name and point it to File’s Owner, and then if/when the nib is connected to the controller if that controller has an outlet with the same name it just works?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:30:48+00:00Added an answer on May 25, 2026 at 1:30 pm

    The File Owner has to have the certain outlet and/or the action when you connect it in IB. Even if you could connect it to an outlet that does not exist, an exception will be raised when the nib is being loaded. I you want to check it make an outlet, connect it to an object, save the nib, delete the outlet from the object and run the application. NSUnknownKeyException will be raised.

    The easiest way would be to use a common superclass of your controller. If the controllers cannot be derived from the common ancestor, the only workaround I see is to make a protocol where you define your outlet properties and actions. Make an object that conforms to the protocol

    MyObject: NSObject < MyNibProtocol >

    now use this object in the nib to connect the outlets and actions.
    However, the properties and methods cannot be optional, you have to implement them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ViewController that has its own NIB. I would like to embed
I have a nib that I load the usual way [NSBundle loadNibNamed:@AuthorizationWindow owner:self]; and
I have a custom NSWindowController subclass that loads a NIB file during initialization like
I have a NIB with two NSWindow objects. The controller class has two IBOutlets,
I have a custom UITableViewCell nib that has an image on the left side
I have a NIB that contains a UINavigationController which has a UIViewController . The
I have a UIViewController that I want to load from a NIB that has
I have a tab bar controller with five buttons. That controller has a tab
I have an iphone app that has a root view with a button that
I have a button in a Nib based view which does not behave like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.