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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:35:27+00:00 2026-05-28T15:35:27+00:00

many thanks for this site. many posts have helped me recently. this window question

  • 0

many thanks for this site. many posts have helped me recently.

this window question seems simple, but I cannot find a simple reference to resolve my need. I’m building a simple app that manages printers. The main screen has a tableview that is driven by an array of data pulled from the cups server. Basically it shows the installed printers on that computer. There are two sub windows. Each with its own window controller and nib file. For clarity I’ll call them sub nibs or sub window controllers. Each one does something a bit different, but affects the system printers. I want to make sure that when the sub window closes and returns control back to the main screen, the main screen window (being controlled by the AppDelegate) responds by reloading the tableview (to update any changes at the OS level with printers).

At a high level, I don’t understand how to send a message back to AppDelegate when I’m in the sub window operating via it’s controller. As an example, say a button is pushed on the sub window nib and you want to modify an ivar controlled in the AppDelegate? seems that that should be simple, but it seems the object models of the parent AppDelegate are not available.

At a lower level, I’m not sure how to make the AppDelegate aware the window closed. I have had luck with getting the sub window controller to be aware that it’s closing via the windowWillClose notification – this works when I set the delegate of the sub nib to the sub window controller. But still the parent controller AppDelegate is not aware and I do not know how to tell the AppDelegate from the sub window controller to do something.

Is the parent AppDelegate made aware via an object message? if so, how? Can the sub nib have a different owner and delegate? is it possible to set the second nib to point to its controller as owner and point back to the AppDelegate as delegate? I tried that but could not figure out how to wire it in connections.

To sum it up, how can I take an action in the AppDelegate after my sub nib via sub controller closes.
Any help would be much appreciated.

  • 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-28T15:35:28+00:00Added an answer on May 28, 2026 at 3:35 pm

    You can use a notification to inform your AppDelegate to take an action. You can make your own notification if you need to, or use an existing one like the WindowWillClose notification. You simply have to tell the NSNotification center that the AppDelegate wants to receive the message, like this:

    [[NSNotificationCenter defaultCenter] addObserver:myAppDelegate
        selector:@selector(subWindowClosed:)
        name:NSWindowWillCloseNotification
        object:subWindow]
    

    This will call your -subWindowClosed: method on the app delegate when the subwindow closes.

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

Sidebar

Related Questions

This is probably a very simple and stupid question to ask, but I have
many many thanks for running this board. I love this site. It has helped
First of all many thanks for clicking into my question. I have a few
I have been browsing this site for the answer but I'm still a little
After reading many related posts on this site on the subject of image comparison
I have researched this topic for months now with no success. Many posts say
I think this has been done many times before but despite reading some posts
Many thanks for the advice you have given me thus far. Using testbenches is
Recently thanks to rails' popularity, many people start using activerecord as model. however, before
This may seem like a basic/stupid/obviously-answered question, but I wanted to check: why use

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.