Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>NSApplication</code> sends the <code>NSApplicationDidFinishLaunchingNotification</code> notification, so you should just be able to register for that in your class:</p> <pre><code>- (void)awakeFromNib { NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(appDidLaunch:) name:NSApplicationDidFinishLaunchingNotification object:nil]; } - (void)appDidLaunch:(NSNotification*)notification { NSLog(@"Blast off!"); } </code></pre> <p>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 <code>‑(void)applicationDidFinishLaunching:(NSNotification*)notification</code> delegate method of <code>NSApplication</code>, will also post a notification when the delegate method is called.</p> <p>For example, <code>NSWindow</code> has a lot of delegate methods with this kind of signature, such as:</p> <pre><code>- (void)windowDidResize:(NSNotification *)notification </code></pre> <p>If you look at <a href="http://developer.apple.com/mac/library/documentation/cocoa/reference/NSWindowDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40008202-CH1-SW10" rel="nofollow noreferrer">the docs</a> for this method, you'll see that the notification that is passed to this delegate method is a <code>NSWindowDidResizeNotification</code>. You can then find more detail about this notification in the <a href="http://developer.apple.com/mac/library/documentation/cocoa/reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/uid/20000013-BCIIHIHC" rel="nofollow noreferrer">notifications section</a> of the <code>NSWindow</code> docs.</p> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload