Re: where does cocoa start up a program?
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