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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:07:56+00:00 2026-05-15T00:07:56+00:00

I have a class in my application which handles all the controls and all

  • 0

I have a class in my application which handles all the controls and all the functions and variables are stored in it. How can I add a function which handles the application startup to it?

So basically I need to handle ‘applicationDidFinishLaunching‘ in my class as well as in the application delegate.

How do I do that?

  • 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-15T00:07:56+00:00Added an answer on May 15, 2026 at 12:07 am

    NSApplication sends the NSApplicationDidFinishLaunchingNotification notification, so you should just be able to register for that in your class:

    - (void)awakeFromNib
    {
        NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
        [nc addObserver:self
               selector:@selector(appDidLaunch:)
                   name:NSApplicationDidFinishLaunchingNotification 
                 object:nil];
    }
    
    - (void)appDidLaunch:(NSNotification*)notification
    {
        NSLog(@"Blast off!");
    }
    

    There’s a general pattern here, in that Cocoa classes that have delegate methods with a method signature that passes a single notification parameter, such as the ‑(void)applicationDidFinishLaunching:(NSNotification*)notification delegate method of NSApplication, will also post a notification when the delegate method is called.

    For example, NSWindow has a lot of delegate methods with this kind of signature, such as:

    - (void)windowDidResize:(NSNotification *)notification
    

    If you look at the docs for this method, you’ll see that the notification that is passed to this delegate method is a NSWindowDidResizeNotification. You can then find more detail about this notification in the notifications section of the NSWindow docs.

    This type of delegate method is often used when there is a likelihood that more than one object will be interested in the delegate information.

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

Sidebar

Related Questions

I have a class within my web application that handles all my database access.
I have an application which uses two methods of an API. Both these methods
I have a class which extends AsyncTask, which is intended to serve as a
I have an java EE application which has one message-driven bean and it runs
I was messing around with JAX-RS and made an application which calls REST services
I am writing my first Android application and have some problems with handing around
I don't know if this is something that can be handled by a DI
I am working on a client / server system: There is a database, an
I'm using Django 1.1 on Google App Engine through use_library . No Django GAE
Once in a while, I notice some coding pattern that I've had for years

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.