• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Program flow in NSApplication
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Program flow in NSApplication


  • Subject: Re: Program flow in NSApplication
  • From: Andreas Schempp <email@hidden>
  • Date: Mon, 28 Apr 2003 16:31:27 +0200 (MEST)

Do get the applicationWillFinishLaunching and the other four functions to
work, you have to register your application at the notification center.

you should do something like this:

- (void) awakeFromNib
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillFinishLaunching:)
name:@"NSApplicationWillFinishLaunchingNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationDidFinishLaunching:)
name:@"NSApplicationDidFinishLaunchingNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillBecomeActive:)
name:@"NSApplicationWillBecomeActiveNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationDidBecomeActive:)
name:@"NSApplicationDidBecomeActiveNotification" object:nil];
}


And check for spelling errors ;-)



> Hi,
>
> I have created a sample application in Cocoa using a
> custom view. i then subclassed the view from
> NSScrollView.
> Now in the code all the coding for creating the
> matrix and NSButtonCells in the matrix is done in -
> (id)initWithFrame:(NSRect)frameRect
>
> I have a delegate from the FistOwner to class instance
> controller. I have defined functions like
> -(void)applicationWillFinishLaunching:(NSNotification
> *)aNotification
> {
>
> }
>
> - (void)applicationDidBecomeActive:(NSNotification
> *)aNotification
> {
>
> }
>
> - (void)applicationDidFinishLaunching:(NSNotification
> *)aNotification
> {
>
> }
>
> - (void)applicationWillBecomeActive:(NSNotification
> *)aNotification
> {
>
> }
>
> just for testing purpose to find whether the program
> control reaches any of these functions. but i found
> that - (id)initWithFrame:(NSRect)frameRect function
> finishes all the processing and control does not reach
> the 4 functions mentioned above.
>
> i had also used -(void)awakefromNib function. But
> when the program starts executing the control first
> goes to - (id)initWithFrame:(NSRect)frameRect.
> What could be going wrong or is this the normal
> behaviour?
> Is there any documentation available which tells the
> flow of the program for NSApplication.
>
> Thanks.
>
> with rgds,
> johnd
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> _______________________________________________
> cocoa-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Program flow in NSApplication
      • From: Tom Sutcliffe <email@hidden>
    • Re: Program flow in NSApplication
      • From: publiclook <email@hidden>
References: 
 >Program flow in NSApplication (From: John Desuza <email@hidden>)

  • Prev by Date: [MEETING] Chicago CAWUG Tuesday, April 29th
  • Next by Date: Re: WeakCache?
  • Previous by thread: Program flow in NSApplication
  • Next by thread: Re: Program flow in NSApplication
  • Index(es):
    • Date
    • Thread