• 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: where does cocoa start up a program?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: where does cocoa start up a program?


  • Subject: Re: where does cocoa start up a program?
  • From: Brian Stern <email@hidden>
  • Date: Sat, 4 Nov 2006 00:02:51 -0500

At 7:25 PM -0800 11/3/06, N!K wrote:
>What if I want some C code to run once at the start of the program,
>not as part of a method whenever (if ever) it is invoked?
>I was advised not to stick it into main.m because Xcode generates
>that and ties it into wherever it's supposed to go.
>Where else could it be placed, using Xcode?

Any of these routines are likely candidates:

in the NSApplication delegate:

+(void)initialize
- (id)init
- (void)applicationWillFinishLaunching:(NSNotification *)notification
- (void)applicationDidFinishLaunching:(NSNotification *)notification

You will most likely instantiate and assign the delegate in IB in your
mainmenu nib.

See the NSApplication documentation and the references to the delegate

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html

--
Brian  Stern
email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: where does cocoa start up a program?
      • From: N!K <email@hidden>
References: 
 >where does cocoa start up a program? (From: N!K <email@hidden>)

  • Prev by Date: Re: where does cocoa start up a program?
  • Next by Date: Re: Oracle Classes using the OCI?
  • Previous by thread: Re: where does cocoa start up a program?
  • Next by thread: Re: where does cocoa start up a program?
  • Index(es):
    • Date
    • Thread