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 6638723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:28:11+00:00 2026-05-25T23:28:11+00:00

I have a Custom class which is supposed to load a window from a

  • 0

I have a Custom class which is supposed to load a window from a nib file.
When I load the nib file everything looks fine except the IBOutlets are not connected i.e. nil. IBActions work fine and when they are called the IBOutlets are not nil anymore.

The class is added to the nib in the IB as an object and obviously everything wired up.

It’s the file’s Owner and delegate

When it loads the nib, the window appears only if its “visible at launch” is set.

It doesn’t matter where I load the nib and try to access IBOutlets immediately or seconds later.

It must be something very trivial…

UPDATE2: I UPLOADED AN EVEN SIMPLER TRIAL PROJECT: Trial Project2

Expected behaviour: Window2 title changes to “Title has Changed x times” when loads. It only starts working once the button is pressed i.e. IBOutlets are not nil anymore.

  • 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-25T23:28:11+00:00Added an answer on May 25, 2026 at 11:28 pm

    I haven’t worked with any of the OS X interface classes, so there may be some aspect of this that is not 100% precisely accurate, but basically what is happening is this:

    You’ve wired your nib’s NSWindow object to a MyClass object, which is also in your nib. So when you load that nib, here’s what’s happening:

    • A MyClass instance is created
    • An NSWindow instance is created, with several subviews. The NSWindow and the button are attached to the new MyClass instance.
    • Nothing is wired to the File’s Owner pseudo-object (the MyClass instance you created in your app delegate)

    Then -changeWindowTitle is called on your original MyClass instance, which has none of its outlets wired.

    The solution is simple: remove the MyClass object from your nib file. Select the “File’s Owner”, and in the Identity Inspector (third icon from the left in the Utility pane) set “Class” to “MyClass”. Now reconnect your outlets to the File’s Owner object, which is your original MyClass instance. You should now see the behavior you expected.

    As an aside, the right place to do things “as soon as the nib is loaded”, like setting properties on your fresh IBOutlet objects, is in the method -windowDidLoad.

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

Sidebar

Related Questions

I have a custom class loader which extends from a URLClassLoader. I added a
I have written a custom server control which (pseudo-code) looks like public class MyCustomCtrl
Suppose I have a junit custom class loader, which reads the test data from
I have a custom UIImageView class which I use to handle multi-touch events on
I have a IEnumerable. I have a custom Interval class which just has two
I currently have a custom session handler class which simply builds on php's session
I have a class which is marked with a custom attribute, like this: public
I have a java class which fires custom java events. The structure of the
I have a datagridview in which one column contains a custom class, which I
i have a validation class which needs improving. If I require some custom validation

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.