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 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 two async classes in my application which you can see below class
I have a class called HeaderView which I use all over my application: public
I have a database class, which manages all my mysql connections for my application.
I have a class within my web application that handles all my database access.
in my zf application i have base model class Application_Model, which connects to db
I have an application which resides in ROOT. This application has a java class(in
I have a model in my rails application which is class Person < ActiveRecord::Base
I have an application App1 which defines class A and uses instances of this
In my application I have a class which has properties of user-defined types like
I have a class which is called a number of times. When the application

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.