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

  • SEARCH
  • Home
  • 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 8603169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:15:40+00:00 2026-06-12T02:15:40+00:00

I have an MainMenu.xib, and AppController is its file owner. I added -(void)awakeFromNib method

  • 0

I have an MainMenu.xib, and AppController is its file owner. I added -(void)awakeFromNib method which worked fine. Now, rounds of fixings down the road awakeFromNib stopped being called, and I can’t figure out why. It owns the xib, so it should be called when it is unarchived. What’s going on?

EDITED:

Well, I renamed awakeFromNib to something, and called that from init… that worked. Still confused as to why awakeFromNib is not. I also have a +(void) initialize method in there, could that be messing something up?

- (id)init {
    self = [super init];
    if (self) {
        [self something];
    }
    return self;
}


-(void)something {
    NSLog(@"yup");
}
  • 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-06-12T02:15:41+00:00Added an answer on June 12, 2026 at 2:15 am

    Setting the class name of the File’s Owner in the nib is only so you can tell Xcode what object’s outlets and actions to show you so you can hook things up. It doesn’t affect what object is actually the File’s Owner when the app runs and the nib gets loaded.

    The MainMenu nib’s File’s Owner is always the application object, no matter what class name you set for the FO in Xcode’s inspector. Setting it to any class name but NSApplication[1] is wrong.

    When you run your app, you should find error messages in the Console about any outlets or actions of the AppController that you tried to connect. They couldn’t be connected because the application object doesn’t have them.

    Change the class name back in the nib editor, and create your AppController as a custom object in the MainMenu nib.


    Well, I renamed awakeFromNib to something, and called that from init… that worked.

    That means that init is getting called, which means you’re calling it. That’s a valid alternative to creating it in a nib, though you shouldn’t override awakeFromNib if it’s not in a nib or owning one.

    Your choice: Continue creating the AppController using alloc and init, or remove that code and create it in the MainMenu nib instead.


    [1]: Or, if you’ve subclassed NSApplication and changed the principal class of your app bundle to be that subclass, the name of that subclass.

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

Sidebar

Related Questions

I have added an NSOpenGLView to my MainMenu.xib file, and have implemented drawRect to
I have an NSMenuItem titled Word Wrap in my main menu (MainMenu.xib). Its value
I have a table view which loads another xib file and uses the content
I now have a MainMenu activity, with a XML file for it's layout. By
I have one class called MainMenu, which has a method called switchViews, with 2
I have a Cocoa app with a ManMenu.xib, in which the main menu is
I´m newbie. I have three xib files in my cocoa app: MainMenu.xib the main
I have unusual format of XML as below example <mainmenu> <menu caption=File> <menuitem caption=New
I have a nib file in which I load at a certain point in
I have MainMenu. There's 3 different ImageButtons for starting new Activities. Everything work fine,

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.